Commit 089003fb authored by Bruce Momjian's avatar Bruce Momjian

pgindent run.

parent 63354a02
#include "btree_gist.h" #include "btree_gist.h"
PG_FUNCTION_INFO_V1(btree_decompress); PG_FUNCTION_INFO_V1(btree_decompress);
Datum btree_decompress(PG_FUNCTION_ARGS); Datum btree_decompress(PG_FUNCTION_ARGS);
/* /*
** GiST DeCompress methods ** GiST DeCompress methods
......
...@@ -23,4 +23,3 @@ typedef struct rix ...@@ -23,4 +23,3 @@ typedef struct rix
extern GIST_SPLITVEC *btree_picksplit(bytea *entryvec, GIST_SPLITVEC *v, extern GIST_SPLITVEC *btree_picksplit(bytea *entryvec, GIST_SPLITVEC *v,
BINARY_UNION bu, CMPFUNC cmp); BINARY_UNION bu, CMPFUNC cmp);
...@@ -28,11 +28,11 @@ extern int cube_yyparse(); ...@@ -28,11 +28,11 @@ extern int cube_yyparse();
NDBOX *cube_in(char *str); NDBOX *cube_in(char *str);
NDBOX *cube(text *str); NDBOX *cube(text *str);
char *cube_out(NDBOX * cube); char *cube_out(NDBOX * cube);
NDBOX *cube_f8(double *); NDBOX *cube_f8(double *);
NDBOX *cube_f8_f8(double *, double *); NDBOX *cube_f8_f8(double *, double *);
NDBOX *cube_c_f8(NDBOX *, double *); NDBOX *cube_c_f8(NDBOX *, double *);
NDBOX *cube_c_f8_f8(NDBOX *, double *, double *); NDBOX *cube_c_f8_f8(NDBOX *, double *, double *);
int4 cube_dim(NDBOX * a); int4 cube_dim(NDBOX * a);
double *cube_ll_coord(NDBOX * a, int4 n); double *cube_ll_coord(NDBOX * a, int4 n);
double *cube_ur_coord(NDBOX * a, int4 n); double *cube_ur_coord(NDBOX * a, int4 n);
...@@ -123,7 +123,7 @@ cube_out(NDBOX * cube) ...@@ -123,7 +123,7 @@ cube_out(NDBOX * cube)
bool equal = true; bool equal = true;
int dim = cube->dim; int dim = cube->dim;
int i; int i;
int ndig; int ndig;
initStringInfo(&buf); initStringInfo(&buf);
...@@ -131,7 +131,8 @@ cube_out(NDBOX * cube) ...@@ -131,7 +131,8 @@ cube_out(NDBOX * cube)
* Get the number of digits to display. * Get the number of digits to display.
*/ */
ndig = DBL_DIG + extra_float_digits; ndig = DBL_DIG + extra_float_digits;
if (ndig < 1) ndig = 1; if (ndig < 1)
ndig = 1;
/* /*
* while printing the first (LL) corner, check if it is equal to the * while printing the first (LL) corner, check if it is equal to the
...@@ -1192,7 +1193,8 @@ cube_enlarge(NDBOX * a, double *r, int4 n) ...@@ -1192,7 +1193,8 @@ cube_enlarge(NDBOX * a, double *r, int4 n)
j, j,
k; k;
if (n > CUBE_MAX_DIM) n = CUBE_MAX_DIM; if (n > CUBE_MAX_DIM)
n = CUBE_MAX_DIM;
if (*r > 0 && n > 0) if (*r > 0 && n > 0)
dim = n; dim = n;
if (a->dim > dim) if (a->dim > dim)
...@@ -1234,14 +1236,15 @@ NDBOX * ...@@ -1234,14 +1236,15 @@ NDBOX *
cube_f8(double *x1) cube_f8(double *x1)
{ {
NDBOX *result; NDBOX *result;
int size; int size;
size = offsetof(NDBOX, x[0]) + sizeof(double) * 2; size = offsetof(NDBOX, x[0]) + sizeof(double) * 2;
result = (NDBOX *) palloc(size); result = (NDBOX *) palloc(size);
memset(result, 0, size); memset(result, 0, size);
result->size = size; result->size = size;
result->dim = 1; result->dim = 1;
result->x[0] = *x1; result->x[0] = *x1;
result->x[1] = *x1; result->x[1] = *x1;
return result; return result;
} }
...@@ -1250,56 +1253,61 @@ NDBOX * ...@@ -1250,56 +1253,61 @@ NDBOX *
cube_f8_f8(double *x1, double *x2) cube_f8_f8(double *x1, double *x2)
{ {
NDBOX *result; NDBOX *result;
int size; int size;
size = offsetof(NDBOX, x[0]) + sizeof(double) * 2; size = offsetof(NDBOX, x[0]) + sizeof(double) * 2;
result = (NDBOX *) palloc(size); result = (NDBOX *) palloc(size);
memset(result, 0, size); memset(result, 0, size);
result->size = size; result->size = size;
result->dim = 1; result->dim = 1;
result->x[0] = *x1; result->x[0] = *x1;
result->x[1] = *x2; result->x[1] = *x2;
return result; return result;
} }
/* Add a dimension to an existing cube with the same values for the new /* Add a dimension to an existing cube with the same values for the new
coordinate */ coordinate */
NDBOX * NDBOX *
cube_c_f8(NDBOX *c, double *x1) cube_c_f8(NDBOX * c, double *x1)
{ {
NDBOX *result; NDBOX *result;
int size; int size;
int i; int i;
size = offsetof(NDBOX, x[0]) + sizeof(double) * (c->dim + 1) * 2;
size = offsetof(NDBOX, x[0]) + sizeof(double) * (c->dim + 1) *2;
result = (NDBOX *) palloc(size); result = (NDBOX *) palloc(size);
memset(result, 0, size); memset(result, 0, size);
result->size = size; result->size = size;
result->dim = c->dim + 1; result->dim = c->dim + 1;
for (i = 0; i < c->dim; i++) { for (i = 0; i < c->dim; i++)
result->x[i] = c->x[i]; {
result->x[result->dim + i] = c->x[c->dim + i]; result->x[i] = c->x[i];
} result->x[result->dim + i] = c->x[c->dim + i];
result->x[result->dim - 1] = *x1; }
result->x[2 * result->dim - 1] = *x1; result->x[result->dim - 1] = *x1;
result->x[2 * result->dim - 1] = *x1;
return result; return result;
} }
/* Add a dimension to an existing cube */ /* Add a dimension to an existing cube */
NDBOX * NDBOX *
cube_c_f8_f8(NDBOX *c, double *x1, double *x2) cube_c_f8_f8(NDBOX * c, double *x1, double *x2)
{ {
NDBOX *result; NDBOX *result;
int size; int size;
int i; int i;
size = offsetof(NDBOX, x[0]) + sizeof(double) * (c->dim + 1) * 2;
size = offsetof(NDBOX, x[0]) + sizeof(double) * (c->dim + 1) *2;
result = (NDBOX *) palloc(size); result = (NDBOX *) palloc(size);
memset(result, 0, size); memset(result, 0, size);
result->size = size; result->size = size;
result->dim = c->dim + 1; result->dim = c->dim + 1;
for (i = 0; i < c->dim; i++) { for (i = 0; i < c->dim; i++)
result->x[i] = c->x[i]; {
result->x[result->dim + i] = c->x[c->dim + i]; result->x[i] = c->x[i];
} result->x[result->dim + i] = c->x[c->dim + i];
result->x[result->dim - 1] = *x1; }
result->x[2 * result->dim - 1] = *x2; result->x[result->dim - 1] = *x1;
result->x[2 * result->dim - 1] = *x2;
return result; return result;
} }
...@@ -443,17 +443,15 @@ do_inserts(PGconn *conn, char *table, dbhead * dbh) ...@@ -443,17 +443,15 @@ do_inserts(PGconn *conn, char *table, dbhead * dbh)
if (result == DBF_VALID) if (result == DBF_VALID)
{ {
query[0] = '\0'; query[0] = '\0';
j = 0; /* counter for fields in the output */ j = 0; /* counter for fields in the output */
for (h = 0; h < dbh->db_nfields; h++) for (h = 0; h < dbh->db_nfields; h++)
{ {
if (!strlen(fields[h].db_name)) /* When the new fieldname is empty, the field is skipped */ if (!strlen(fields[h].db_name)) /* When the new fieldname
{ * is empty, the field is
* skipped */
continue; continue;
}
else else
{
j++; j++;
}
if (j > 1) /* not for the first field! */ if (j > 1) /* not for the first field! */
strcat(query, "\t"); /* COPY statement field strcat(query, "\t"); /* COPY statement field
......
This diff is collapsed.
/**************************************************************************** /****************************************************************************
* pending.c * pending.c
* $Id: pending.c,v 1.12 2003/07/24 17:52:20 tgl Exp $ * $Id: pending.c,v 1.13 2003/08/04 00:43:10 momjian Exp $
* *
* This file contains a trigger for Postgresql-7.x to record changes to tables * This file contains a trigger for Postgresql-7.x to record changes to tables
* to a pending table for mirroring. * to a pending table for mirroring.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* Written by Steven Singer (ssinger@navtechinc.com) * Written by Steven Singer (ssinger@navtechinc.com)
* (c) 2001-2002 Navtech Systems Support Inc. * (c) 2001-2002 Navtech Systems Support Inc.
* ALL RIGHTS RESERVED * ALL RIGHTS RESERVED
* *
* Permission to use, copy, modify, and distribute this software and its * Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose, without fee, and without a written agreement * documentation for any purpose, without fee, and without a written agreement
...@@ -79,8 +79,9 @@ recordchange(PG_FUNCTION_ARGS) ...@@ -79,8 +79,9 @@ recordchange(PG_FUNCTION_ARGS)
HeapTuple retTuple = NULL; HeapTuple retTuple = NULL;
char *tblname; char *tblname;
char op = 0; char op = 0;
char *schemaname; char *schemaname;
char *fullyqualtblname; char *fullyqualtblname;
if (fcinfo->context != NULL) if (fcinfo->context != NULL)
{ {
...@@ -94,13 +95,13 @@ recordchange(PG_FUNCTION_ARGS) ...@@ -94,13 +95,13 @@ recordchange(PG_FUNCTION_ARGS)
tblname = SPI_getrelname(trigdata->tg_relation); tblname = SPI_getrelname(trigdata->tg_relation);
#ifndef NOSCHEMAS #ifndef NOSCHEMAS
schemaname = get_namespace_name(RelationGetNamespace(trigdata->tg_relation)); schemaname = get_namespace_name(RelationGetNamespace(trigdata->tg_relation));
fullyqualtblname = SPI_palloc(strlen(tblname) + fullyqualtblname = SPI_palloc(strlen(tblname) +
strlen(schemaname) + 6); strlen(schemaname) + 6);
sprintf(fullyqualtblname,"\"%s\".\"%s\"", sprintf(fullyqualtblname, "\"%s\".\"%s\"",
schemaname,tblname); schemaname, tblname);
#else #else
fullyqualtblname = SPI_palloc(strlen(tblname) + 3); fullyqualtblname = SPI_palloc(strlen(tblname) + 3);
sprintf(fullyqualtblname,"\"%s\"",tblname); sprintf(fullyqualtblname, "\"%s\"", tblname);
#endif #endif
tupdesc = trigdata->tg_relation->rd_att; tupdesc = trigdata->tg_relation->rd_att;
if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event)) if (TRIGGER_FIRED_BY_UPDATE(trigdata->tg_event))
...@@ -166,8 +167,8 @@ storePending(char *cpTableName, HeapTuple tBeforeTuple, ...@@ -166,8 +167,8 @@ storePending(char *cpTableName, HeapTuple tBeforeTuple,
int iResult = 0; int iResult = 0;
HeapTuple tCurTuple; HeapTuple tCurTuple;
//Points the current tuple(before or after) /* Points the current tuple(before or after) */
Datum saPlanData[4]; Datum saPlanData[4];
Oid taPlanArgTypes[3] = {NAMEOID, CHAROID, INT4OID}; Oid taPlanArgTypes[3] = {NAMEOID, CHAROID, INT4OID};
void *vpPlan; void *vpPlan;
...@@ -253,7 +254,7 @@ storeKeyInfo(char *cpTableName, HeapTuple tTupleData, ...@@ -253,7 +254,7 @@ storeKeyInfo(char *cpTableName, HeapTuple tTupleData,
if (cpKeyData == NULL) if (cpKeyData == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT), (errcode(ERRCODE_UNDEFINED_OBJECT),
/* cpTableName already contains quotes... */ /* cpTableName already contains quotes... */
errmsg("there is no PRIMARY KEY for table %s", errmsg("there is no PRIMARY KEY for table %s",
cpTableName))); cpTableName)));
...@@ -460,7 +461,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, ...@@ -460,7 +461,7 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
} }
else else
{ {
sprintf(cpFormatedPtr," "); sprintf(cpFormatedPtr, " ");
iUsedDataBlock++; iUsedDataBlock++;
cpFormatedPtr++; cpFormatedPtr++;
continue; continue;
...@@ -508,8 +509,8 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc, ...@@ -508,8 +509,8 @@ packageData(HeapTuple tTupleData, TupleDesc tTupleDesc,
if (tpPKeys != NULL) if (tpPKeys != NULL)
SPI_pfree(tpPKeys); SPI_pfree(tpPKeys);
#if defined DEBUG_OUTPUT #if defined DEBUG_OUTPUT
elog(NOTICE, "returning DataBlockSize:%d iUsedDataBlock:%d",iDataBlockSize, elog(NOTICE, "returning DataBlockSize:%d iUsedDataBlock:%d", iDataBlockSize,
iUsedDataBlock); iUsedDataBlock);
#endif #endif
memset(cpDataBlock + iUsedDataBlock, 0, iDataBlockSize - iUsedDataBlock); memset(cpDataBlock + iUsedDataBlock, 0, iDataBlockSize - iUsedDataBlock);
......
...@@ -54,7 +54,7 @@ database_size(PG_FUNCTION_ARGS) ...@@ -54,7 +54,7 @@ database_size(PG_FUNCTION_ARGS)
if (!OidIsValid(dbid)) if (!OidIsValid(dbid))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_DATABASE), (errcode(ERRCODE_UNDEFINED_DATABASE),
errmsg("database \"%s\" does not exist", NameStr(*dbname)))); errmsg("database \"%s\" does not exist", NameStr(*dbname))));
dbpath = GetDatabasePath(dbid); dbpath = GetDatabasePath(dbid);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
/* Earth's radius is in statute miles. */ /* Earth's radius is in statute miles. */
const double EARTH_RADIUS = 3958.747716; const double EARTH_RADIUS = 3958.747716;
const double TWO_PI = 2.0 * M_PI; const double TWO_PI = 2.0 * M_PI;
double *geo_distance(Point *pt1, Point *pt2); double *geo_distance(Point *pt1, Point *pt2);
...@@ -66,10 +66,11 @@ geo_distance(Point *pt1, Point *pt2) ...@@ -66,10 +66,11 @@ geo_distance(Point *pt1, Point *pt2)
if (longdiff > M_PI) if (longdiff > M_PI)
longdiff = TWO_PI - longdiff; longdiff = TWO_PI - longdiff;
sino = sqrt(sin(fabs(lat1-lat2)/2.)*sin(fabs(lat1-lat2)/2.) + sino = sqrt(sin(fabs(lat1 - lat2) / 2.) * sin(fabs(lat1 - lat2) / 2.) +
cos(lat1) * cos(lat2) * sin(longdiff/2.)*sin(longdiff/2.)); cos(lat1) * cos(lat2) * sin(longdiff / 2.) * sin(longdiff / 2.));
if (sino > 1.) sino = 1.; if (sino > 1.)
*resultp = 2. * EARTH_RADIUS * asin(sino); sino = 1.;
*resultp = 2. * EARTH_RADIUS * asin(sino);
return resultp; return resultp;
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright 2002 by PostgreSQL Global Development Group * Copyright 2002 by PostgreSQL Global Development Group
* *
* $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/findoidjoins.c,v 1.20 2003/05/14 03:25:56 tgl Exp $ * $Header: /cvsroot/pgsql/contrib/findoidjoins/Attic/findoidjoins.c,v 1.21 2003/08/04 00:43:10 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -14,23 +14,24 @@ ...@@ -14,23 +14,24 @@
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
PGconn *conn; PGconn *conn;
PQExpBufferData sql; PQExpBufferData sql;
PGresult *res; PGresult *res;
PGresult *pkrel_res; PGresult *pkrel_res;
PGresult *fkrel_res; PGresult *fkrel_res;
char *fk_relname; char *fk_relname;
char *fk_nspname; char *fk_nspname;
char *fk_attname; char *fk_attname;
char *pk_relname; char *pk_relname;
char *pk_nspname; char *pk_nspname;
int fk, pk; /* loop counters */ int fk,
pk; /* loop counters */
if (argc != 2) if (argc != 2)
{ {
fprintf(stderr, "Usage: %s database\n", argv[0]); fprintf(stderr, "Usage: %s database\n", argv[0]);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
initPQExpBuffer(&sql); initPQExpBuffer(&sql);
...@@ -48,13 +49,13 @@ main(int argc, char **argv) ...@@ -48,13 +49,13 @@ main(int argc, char **argv)
resetPQExpBuffer(&sql); resetPQExpBuffer(&sql);
appendPQExpBuffer(&sql, "%s", appendPQExpBuffer(&sql, "%s",
"SET search_path = public;" "SET search_path = public;"
"SELECT c.relname, (SELECT nspname FROM " "SELECT c.relname, (SELECT nspname FROM "
"pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname " "pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname "
"FROM pg_catalog.pg_class c " "FROM pg_catalog.pg_class c "
"WHERE c.relkind = 'r' " "WHERE c.relkind = 'r' "
"AND c.relhasoids " "AND c.relhasoids "
"ORDER BY nspname, c.relname" "ORDER BY nspname, c.relname"
); );
res = PQexec(conn, sql.data); res = PQexec(conn, sql.data);
...@@ -70,20 +71,20 @@ main(int argc, char **argv) ...@@ -70,20 +71,20 @@ main(int argc, char **argv)
resetPQExpBuffer(&sql); resetPQExpBuffer(&sql);
appendPQExpBuffer(&sql, "%s", appendPQExpBuffer(&sql, "%s",
"SELECT c.relname, " "SELECT c.relname, "
"(SELECT nspname FROM pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname, " "(SELECT nspname FROM pg_catalog.pg_namespace n WHERE n.oid = c.relnamespace) AS nspname, "
"a.attname " "a.attname "
"FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a " "FROM pg_catalog.pg_class c, pg_catalog.pg_attribute a "
"WHERE a.attnum > 0 AND c.relkind = 'r' " "WHERE a.attnum > 0 AND c.relkind = 'r' "
"AND a.attrelid = c.oid " "AND a.attrelid = c.oid "
"AND a.atttypid IN ('pg_catalog.oid'::regtype, " "AND a.atttypid IN ('pg_catalog.oid'::regtype, "
" 'pg_catalog.regclass'::regtype, " " 'pg_catalog.regclass'::regtype, "
" 'pg_catalog.regoper'::regtype, " " 'pg_catalog.regoper'::regtype, "
" 'pg_catalog.regoperator'::regtype, " " 'pg_catalog.regoperator'::regtype, "
" 'pg_catalog.regproc'::regtype, " " 'pg_catalog.regproc'::regtype, "
" 'pg_catalog.regprocedure'::regtype, " " 'pg_catalog.regprocedure'::regtype, "
" 'pg_catalog.regtype'::regtype) " " 'pg_catalog.regtype'::regtype) "
"ORDER BY nspname, c.relname, a.attnum" "ORDER BY nspname, c.relname, a.attnum"
); );
res = PQexec(conn, sql.data); res = PQexec(conn, sql.data);
...@@ -95,8 +96,8 @@ main(int argc, char **argv) ...@@ -95,8 +96,8 @@ main(int argc, char **argv)
fkrel_res = res; fkrel_res = res;
/* /*
* For each column and each relation-having-OIDs, look to see if * For each column and each relation-having-OIDs, look to see if the
* the column contains any values matching entries in the relation. * column contains any values matching entries in the relation.
*/ */
for (fk = 0; fk < PQntuples(fkrel_res); fk++) for (fk = 0; fk < PQntuples(fkrel_res); fk++)
...@@ -113,12 +114,12 @@ main(int argc, char **argv) ...@@ -113,12 +114,12 @@ main(int argc, char **argv)
resetPQExpBuffer(&sql); resetPQExpBuffer(&sql);
appendPQExpBuffer(&sql, appendPQExpBuffer(&sql,
"SELECT 1 " "SELECT 1 "
"FROM \"%s\".\"%s\" t1, " "FROM \"%s\".\"%s\" t1, "
"\"%s\".\"%s\" t2 " "\"%s\".\"%s\" t2 "
"WHERE t1.\"%s\"::pg_catalog.oid = t2.oid " "WHERE t1.\"%s\"::pg_catalog.oid = t2.oid "
"LIMIT 1", "LIMIT 1",
fk_nspname, fk_relname, pk_nspname, pk_relname, fk_attname); fk_nspname, fk_relname, pk_nspname, pk_relname, fk_attname);
res = PQexec(conn, sql.data); res = PQexec(conn, sql.data);
if (!res || PQresultStatus(res) != PGRES_TUPLES_OK) if (!res || PQresultStatus(res) != PGRES_TUPLES_OK)
......
...@@ -304,7 +304,7 @@ fti(PG_FUNCTION_ARGS) ...@@ -304,7 +304,7 @@ fti(PG_FUNCTION_ARGS)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN), (errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("column \"%s\" of \"%s\" does not exist", errmsg("column \"%s\" of \"%s\" does not exist",
args[i + 1], indexname))); args[i + 1], indexname)));
/* Get the char* representation of the column */ /* Get the char* representation of the column */
column = SPI_getvalue(rettuple, tupdesc, colnum); column = SPI_getvalue(rettuple, tupdesc, colnum);
...@@ -339,8 +339,8 @@ fti(PG_FUNCTION_ARGS) ...@@ -339,8 +339,8 @@ fti(PG_FUNCTION_ARGS)
ret = SPI_execp(*(plan->splan), values, NULL, 0); ret = SPI_execp(*(plan->splan), values, NULL, 0);
if (ret != SPI_OK_INSERT) if (ret != SPI_OK_INSERT)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
errmsg("error executing insert"))); errmsg("error executing insert")));
} }
pfree(buff); pfree(buff);
pfree(data); pfree(data);
......
...@@ -87,7 +87,7 @@ levenshtein(PG_FUNCTION_ARGS) ...@@ -87,7 +87,7 @@ levenshtein(PG_FUNCTION_ARGS)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("argument exceeds max length: %d", errmsg("argument exceeds max length: %d",
MAX_LEVENSHTEIN_STRLEN))); MAX_LEVENSHTEIN_STRLEN)));
/* /*
* If either rows or cols is 0, the answer is the other value. This * If either rows or cols is 0, the answer is the other value. This
...@@ -220,7 +220,7 @@ metaphone(PG_FUNCTION_ARGS) ...@@ -220,7 +220,7 @@ metaphone(PG_FUNCTION_ARGS)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("argument exceeds max length: %d", errmsg("argument exceeds max length: %d",
MAX_METAPHONE_STRLEN))); MAX_METAPHONE_STRLEN)));
if (!(str_i_len > 0)) if (!(str_i_len > 0))
ereport(ERROR, ereport(ERROR,
...@@ -232,7 +232,7 @@ metaphone(PG_FUNCTION_ARGS) ...@@ -232,7 +232,7 @@ metaphone(PG_FUNCTION_ARGS)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("output length exceeds max length: %d", errmsg("output length exceeds max length: %d",
MAX_METAPHONE_STRLEN))); MAX_METAPHONE_STRLEN)));
if (!(reqlen > 0)) if (!(reqlen > 0))
ereport(ERROR, ereport(ERROR,
......
...@@ -132,9 +132,9 @@ ShrinkPGArray(PGARRAY * p) ...@@ -132,9 +132,9 @@ ShrinkPGArray(PGARRAY * p)
/* use current transaction context */ /* use current transaction context */
pnew = palloc(cb); pnew = palloc(cb);
/* /*
* Fix up the fields in the new structure, so Postgres * Fix up the fields in the new structure, so Postgres understands
* understands
*/ */
memcpy(pnew, p, cb); memcpy(pnew, p, cb);
pnew->a.size = cb; pnew->a.size = cb;
...@@ -194,7 +194,7 @@ int_enum(PG_FUNCTION_ARGS) ...@@ -194,7 +194,7 @@ int_enum(PG_FUNCTION_ARGS)
if (!rsi || !IsA(rsi, ReturnSetInfo)) if (!rsi || !IsA(rsi, ReturnSetInfo))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED), (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("int_enum called in context that cannot accept a set"))); errmsg("int_enum called in context that cannot accept a set")));
if (!p) if (!p)
{ {
......
...@@ -91,19 +91,19 @@ typedef char *BITVECP; ...@@ -91,19 +91,19 @@ typedef char *BITVECP;
*/ */
typedef struct typedef struct
{ {
int4 len; int4 len;
int4 flag; int4 flag;
char data[1]; char data[1];
} GISTTYPE; } GISTTYPE;
#define ALLISTRUE 0x04 #define ALLISTRUE 0x04
#define ISALLTRUE(x) ( ((GISTTYPE*)x)->flag & ALLISTRUE ) #define ISALLTRUE(x) ( ((GISTTYPE*)x)->flag & ALLISTRUE )
#define GTHDRSIZE ( sizeof(int4)*2 ) #define GTHDRSIZE ( sizeof(int4)*2 )
#define CALCGTSIZE(flag) ( GTHDRSIZE+(((flag) & ALLISTRUE) ? 0 : SIGLEN) ) #define CALCGTSIZE(flag) ( GTHDRSIZE+(((flag) & ALLISTRUE) ? 0 : SIGLEN) )
#define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) ) #define GETSIGN(x) ( (BITVECP)( (char*)x+GTHDRSIZE ) )
/* /*
** types for functions ** types for functions
...@@ -114,22 +114,22 @@ typedef void (*formfloat) (ArrayType *, float *); ...@@ -114,22 +114,22 @@ typedef void (*formfloat) (ArrayType *, float *);
/* /*
** useful function ** useful function
*/ */
bool isort(int4 *a, const int len); bool isort(int4 *a, const int len);
ArrayType *new_intArrayType(int num); ArrayType *new_intArrayType(int num);
ArrayType *copy_intArrayType(ArrayType *a); ArrayType *copy_intArrayType(ArrayType *a);
ArrayType *resize_intArrayType(ArrayType *a, int num); ArrayType *resize_intArrayType(ArrayType *a, int num);
int internal_size(int *a, int len); int internal_size(int *a, int len);
ArrayType *_int_unique(ArrayType *a); ArrayType *_int_unique(ArrayType *a);
int32 intarray_match_first(ArrayType *a, int32 elem); int32 intarray_match_first(ArrayType *a, int32 elem);
ArrayType *intarray_add_elem(ArrayType *a, int32 elem); ArrayType *intarray_add_elem(ArrayType *a, int32 elem);
ArrayType *intarray_concat_arrays(ArrayType *a, ArrayType *b); ArrayType *intarray_concat_arrays(ArrayType *a, ArrayType *b);
ArrayType *int_to_intset(int32 elem); ArrayType *int_to_intset(int32 elem);
bool inner_int_overlap(ArrayType *a, ArrayType *b); bool inner_int_overlap(ArrayType *a, ArrayType *b);
bool inner_int_contains(ArrayType *a, ArrayType *b); bool inner_int_contains(ArrayType *a, ArrayType *b);
ArrayType * inner_int_union(ArrayType *a, ArrayType *b); ArrayType *inner_int_union(ArrayType *a, ArrayType *b);
ArrayType * inner_int_inter(ArrayType *a, ArrayType *b); ArrayType *inner_int_inter(ArrayType *a, ArrayType *b);
void rt__int_size(ArrayType *a, float *size); void rt__int_size(ArrayType *a, float *size);
void gensign(BITVEC sign, int *a, int len); void gensign(BITVEC sign, int *a, int len);
/***************************************************************************** /*****************************************************************************
...@@ -160,18 +160,16 @@ typedef struct ...@@ -160,18 +160,16 @@ typedef struct
#define COMPUTESIZE(size) ( HDRSIZEQT + size * sizeof(ITEM) ) #define COMPUTESIZE(size) ( HDRSIZEQT + size * sizeof(ITEM) )
#define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT ) #define GETQUERY(x) (ITEM*)( (char*)(x)+HDRSIZEQT )
bool signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot); bool signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot);
bool execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot); bool execconsistent(QUERYTYPE * query, ArrayType *array, bool calcnot);
int compASC(const void *a, const void *b);
int compDESC(const void *a, const void *b);
#define QSORT(a, direction) \ int compASC(const void *a, const void *b);
if (ARRNELEMS(a) > 1) \
qsort((void*)ARRPTR(a), ARRNELEMS(a),sizeof(int4), \
(direction) ? compASC : compDESC )
int compDESC(const void *a, const void *b);
#define QSORT(a, direction) \
if (ARRNELEMS(a) > 1) \
qsort((void*)ARRPTR(a), ARRNELEMS(a),sizeof(int4), \
(direction) ? compASC : compDESC )
...@@ -299,7 +299,7 @@ signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot) ...@@ -299,7 +299,7 @@ signconsistent(QUERYTYPE * query, BITVEC sign, bool calcnot)
GETQUERY(query) + query->size - 1, GETQUERY(query) + query->size - 1,
(void *) sign, calcnot, (void *) sign, calcnot,
checkcondition_bit checkcondition_bit
); );
} }
bool bool
...@@ -326,7 +326,7 @@ rboolop(PG_FUNCTION_ARGS) ...@@ -326,7 +326,7 @@ rboolop(PG_FUNCTION_ARGS)
boolop, boolop,
PG_GETARG_DATUM(1), PG_GETARG_DATUM(1),
PG_GETARG_DATUM(0) PG_GETARG_DATUM(0)
); );
} }
Datum Datum
...@@ -743,4 +743,3 @@ querytree(PG_FUNCTION_ARGS) ...@@ -743,4 +743,3 @@ querytree(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(res); PG_RETURN_POINTER(res);
} }
...@@ -85,27 +85,31 @@ g_int_consistent(PG_FUNCTION_ARGS) ...@@ -85,27 +85,31 @@ g_int_consistent(PG_FUNCTION_ARGS)
} }
Datum Datum
g_int_union(PG_FUNCTION_ARGS) { g_int_union(PG_FUNCTION_ARGS)
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0); {
int *size = (int *) PG_GETARG_POINTER(1); bytea *entryvec = (bytea *) PG_GETARG_POINTER(0);
int4 i,len = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY); int *size = (int *) PG_GETARG_POINTER(1);
ArrayType *res; int4 i,
int totlen=0,*ptr; len = (VARSIZE(entryvec) - VARHDRSZ) / sizeof(GISTENTRY);
ArrayType *res;
int totlen = 0,
*ptr;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
totlen+=ARRNELEMS( GETENTRY(entryvec,i) ); totlen += ARRNELEMS(GETENTRY(entryvec, i));
res=new_intArrayType(totlen); res = new_intArrayType(totlen);
ptr=ARRPTR(res); ptr = ARRPTR(res);
for (i = 0; i < len; i++) { for (i = 0; i < len; i++)
memcpy(ptr, ARRPTR( GETENTRY(entryvec,i) ), ARRNELEMS( GETENTRY(entryvec,i) )*sizeof(int4) ); {
ptr+=ARRNELEMS( GETENTRY(entryvec,i) ); memcpy(ptr, ARRPTR(GETENTRY(entryvec, i)), ARRNELEMS(GETENTRY(entryvec, i)) * sizeof(int4));
ptr += ARRNELEMS(GETENTRY(entryvec, i));
} }
QSORT(res,1); QSORT(res, 1);
res=_int_unique(res); res = _int_unique(res);
*size = VARSIZE(res); *size = VARSIZE(res);
PG_RETURN_POINTER(res); PG_RETURN_POINTER(res);
} }
...@@ -239,22 +243,23 @@ g_int_decompress(PG_FUNCTION_ARGS) ...@@ -239,22 +243,23 @@ g_int_decompress(PG_FUNCTION_ARGS)
** The GiST Penalty method for _intments ** The GiST Penalty method for _intments
*/ */
Datum Datum
g_int_penalty(PG_FUNCTION_ARGS) { g_int_penalty(PG_FUNCTION_ARGS)
GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0); {
GISTENTRY *newentry = (GISTENTRY *) PG_GETARG_POINTER(1); GISTENTRY *origentry = (GISTENTRY *) PG_GETARG_POINTER(0);
float *result = (float *) PG_GETARG_POINTER(2); GISTENTRY *newentry = (GISTENTRY *) PG_GETARG_POINTER(1);
float *result = (float *) PG_GETARG_POINTER(2);
ArrayType *ud; ArrayType *ud;
float tmp1, float tmp1,
tmp2; tmp2;
ud = inner_int_union((ArrayType *) DatumGetPointer(origentry->key), ud = inner_int_union((ArrayType *) DatumGetPointer(origentry->key),
(ArrayType *) DatumGetPointer(newentry->key)); (ArrayType *) DatumGetPointer(newentry->key));
rt__int_size(ud, &tmp1); rt__int_size(ud, &tmp1);
rt__int_size((ArrayType *) DatumGetPointer(origentry->key), &tmp2); rt__int_size((ArrayType *) DatumGetPointer(origentry->key), &tmp2);
*result = tmp1 - tmp2; *result = tmp1 - tmp2;
pfree(ud); pfree(ud);
PG_RETURN_POINTER (result); PG_RETURN_POINTER(result);
} }
...@@ -311,8 +316,9 @@ comparecost(const void *a, const void *b) ...@@ -311,8 +316,9 @@ comparecost(const void *a, const void *b)
** We use Guttman's poly time split algorithm ** We use Guttman's poly time split algorithm
*/ */
Datum Datum
g_int_picksplit(PG_FUNCTION_ARGS) { g_int_picksplit(PG_FUNCTION_ARGS)
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0); {
bytea *entryvec = (bytea *) PG_GETARG_POINTER(0);
GIST_SPLITVEC *v = (GIST_SPLITVEC *) PG_GETARG_POINTER(1); GIST_SPLITVEC *v = (GIST_SPLITVEC *) PG_GETARG_POINTER(1);
OffsetNumber i, OffsetNumber i,
j; j;
...@@ -501,4 +507,3 @@ g_int_picksplit(PG_FUNCTION_ARGS) { ...@@ -501,4 +507,3 @@ g_int_picksplit(PG_FUNCTION_ARGS) {
PG_RETURN_POINTER(v); PG_RETURN_POINTER(v);
} }
...@@ -270,7 +270,7 @@ _int_unique(ArrayType *r) ...@@ -270,7 +270,7 @@ _int_unique(ArrayType *r)
*data; *data;
int num = ARRNELEMS(r); int num = ARRNELEMS(r);
if ( num<2 ) if (num < 2)
return r; return r;
data = tmp = dr = ARRPTR(r); data = tmp = dr = ARRPTR(r);
...@@ -367,4 +367,3 @@ compDESC(const void *a, const void *b) ...@@ -367,4 +367,3 @@ compDESC(const void *a, const void *b)
return 0; return 0;
return (*(int4 *) a < *(int4 *) b) ? 1 : -1; return (*(int4 *) a < *(int4 *) b) ? 1 : -1;
} }
...@@ -45,8 +45,8 @@ array_iterator(ArrayType *la, PGCALL2 callback, void *param, ltree ** found) ...@@ -45,8 +45,8 @@ array_iterator(ArrayType *la, PGCALL2 callback, void *param, ltree ** found)
if (ARR_NDIM(la) != 1) if (ARR_NDIM(la) != 1)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("array must be one-dimensional"))); errmsg("array must be one-dimensional")));
if (found) if (found)
*found = NULL; *found = NULL;
...@@ -133,38 +133,40 @@ _ltq_rregex(PG_FUNCTION_ARGS) ...@@ -133,38 +133,40 @@ _ltq_rregex(PG_FUNCTION_ARGS)
Datum Datum
_lt_q_regex(PG_FUNCTION_ARGS) _lt_q_regex(PG_FUNCTION_ARGS)
{ {
ArrayType *_tree = PG_GETARG_ARRAYTYPE_P(0); ArrayType *_tree = PG_GETARG_ARRAYTYPE_P(0);
ArrayType *_query = PG_GETARG_ARRAYTYPE_P(1); ArrayType *_query = PG_GETARG_ARRAYTYPE_P(1);
lquery *query = (lquery *) ARR_DATA_PTR(_query); lquery *query = (lquery *) ARR_DATA_PTR(_query);
bool res = false; bool res = false;
int num = ArrayGetNItems(ARR_NDIM(_query), ARR_DIMS(_query)); int num = ArrayGetNItems(ARR_NDIM(_query), ARR_DIMS(_query));
if (ARR_NDIM(_query) != 1) if (ARR_NDIM(_query) != 1)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("array must be one-dimensional"))); errmsg("array must be one-dimensional")));
while (num > 0) { while (num > 0)
if ( array_iterator(_tree, ltq_regex, (void*)query, NULL) ) { {
res = true; if (array_iterator(_tree, ltq_regex, (void *) query, NULL))
break; {
} res = true;
num--; break;
query = (lquery*)NEXTVAL(query); }
} num--;
query = (lquery *) NEXTVAL(query);
PG_FREE_IF_COPY(_tree, 0); }
PG_FREE_IF_COPY(_query, 1);
PG_RETURN_BOOL(res); PG_FREE_IF_COPY(_tree, 0);
PG_FREE_IF_COPY(_query, 1);
PG_RETURN_BOOL(res);
} }
Datum Datum
_lt_q_rregex(PG_FUNCTION_ARGS) _lt_q_rregex(PG_FUNCTION_ARGS)
{ {
PG_RETURN_DATUM(DirectFunctionCall2(_lt_q_regex, PG_RETURN_DATUM(DirectFunctionCall2(_lt_q_regex,
PG_GETARG_DATUM(1), PG_GETARG_DATUM(1),
PG_GETARG_DATUM(0) PG_GETARG_DATUM(0)
)); ));
} }
......
...@@ -45,7 +45,7 @@ getlexem(char *start, char *end, int *len) ...@@ -45,7 +45,7 @@ getlexem(char *start, char *end, int *len)
} }
bool bool
compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend) compare_subnode(ltree_level * t, char *qn, int len, int (*cmpptr) (const char *, const char *, size_t), bool anyend)
{ {
char *endt = t->name + t->len; char *endt = t->name + t->len;
char *endq = qn + len; char *endq = qn + len;
...@@ -123,10 +123,15 @@ printFieldNot(FieldNot *fn ) { ...@@ -123,10 +123,15 @@ printFieldNot(FieldNot *fn ) {
} }
*/ */
static struct { static struct
bool muse; {
uint32 high_pos; bool muse;
} SomeStack = {false,0,}; uint32 high_pos;
} SomeStack =
{
false, 0,
};
static bool static bool
checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_numlevel, FieldNot * ptr) checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_numlevel, FieldNot * ptr)
...@@ -140,7 +145,8 @@ checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_ ...@@ -140,7 +145,8 @@ checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_
lquery_level *prevq = NULL; lquery_level *prevq = NULL;
ltree_level *prevt = NULL; ltree_level *prevt = NULL;
if ( SomeStack.muse ) { if (SomeStack.muse)
{
high_pos = SomeStack.high_pos; high_pos = SomeStack.high_pos;
qlen--; qlen--;
prevq = curq; prevq = curq;
...@@ -200,13 +206,15 @@ checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_ ...@@ -200,13 +206,15 @@ checkCond(lquery_level * curq, int query_numlevel, ltree_level * curt, int tree_
curt = LEVEL_NEXT(curt); curt = LEVEL_NEXT(curt);
tlen--; tlen--;
cur_tpos++; cur_tpos++;
if ( isok && prevq && prevq->numvar==0 && tlen>0 && cur_tpos <= high_pos ) { if (isok && prevq && prevq->numvar == 0 && tlen > 0 && cur_tpos <= high_pos)
FieldNot tmpptr; {
if ( ptr ) FieldNot tmpptr;
memcpy(&tmpptr,ptr,sizeof(FieldNot));
SomeStack.high_pos = high_pos-cur_tpos; if (ptr)
memcpy(&tmpptr, ptr, sizeof(FieldNot));
SomeStack.high_pos = high_pos - cur_tpos;
SomeStack.muse = true; SomeStack.muse = true;
if ( checkCond(prevq, qlen+1, curt, tlen, (ptr) ? &tmpptr : NULL) ) if (checkCond(prevq, qlen + 1, curt, tlen, (ptr) ? &tmpptr : NULL))
return true; return true;
} }
if (!isok && ptr) if (!isok && ptr)
...@@ -311,19 +319,21 @@ Datum ...@@ -311,19 +319,21 @@ Datum
lt_q_regex(PG_FUNCTION_ARGS) lt_q_regex(PG_FUNCTION_ARGS)
{ {
ltree *tree = PG_GETARG_LTREE(0); ltree *tree = PG_GETARG_LTREE(0);
ArrayType *_query = PG_GETARG_ARRAYTYPE_P(1); ArrayType *_query = PG_GETARG_ARRAYTYPE_P(1);
lquery *query = (lquery *) ARR_DATA_PTR(_query); lquery *query = (lquery *) ARR_DATA_PTR(_query);
bool res = false; bool res = false;
int num = ArrayGetNItems(ARR_NDIM(_query), ARR_DIMS(_query)); int num = ArrayGetNItems(ARR_NDIM(_query), ARR_DIMS(_query));
if (ARR_NDIM(_query) != 1) if (ARR_NDIM(_query) != 1)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR), (errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
errmsg("array must be one-dimensional"))); errmsg("array must be one-dimensional")));
while (num > 0) { while (num > 0)
{
if (DatumGetBool(DirectFunctionCall2(ltq_regex, if (DatumGetBool(DirectFunctionCall2(ltq_regex,
PointerGetDatum(tree), PointerGetDatum(query)))) { PointerGetDatum(tree), PointerGetDatum(query))))
{
res = true; res = true;
break; break;
...@@ -345,5 +355,3 @@ lt_q_rregex(PG_FUNCTION_ARGS) ...@@ -345,5 +355,3 @@ lt_q_rregex(PG_FUNCTION_ARGS)
PG_GETARG_DATUM(0) PG_GETARG_DATUM(0)
)); ));
} }
...@@ -22,7 +22,7 @@ Datum lquery_out(PG_FUNCTION_ARGS); ...@@ -22,7 +22,7 @@ Datum lquery_out(PG_FUNCTION_ARGS);
#define UNCHAR ereport(ERROR, \ #define UNCHAR ereport(ERROR, \
(errcode(ERRCODE_SYNTAX_ERROR), \ (errcode(ERRCODE_SYNTAX_ERROR), \
errmsg("syntax error at position %d near \"%c\"", \ errmsg("syntax error at position %d near \"%c\"", \
(int)(ptr-buf), *ptr))); (int)(ptr-buf), *ptr)));
...@@ -81,8 +81,8 @@ ltree_in(PG_FUNCTION_ARGS) ...@@ -81,8 +81,8 @@ ltree_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_NAME_TOO_LONG), (errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"), errmsg("name of level is too long"),
errdetail("name length is %d, must " \ errdetail("name length is %d, must " \
"be < 256, in position %d", "be < 256, in position %d",
lptr->len, (int) (lptr->start - buf)))); lptr->len, (int) (lptr->start - buf))));
totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE); totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
lptr++; lptr++;
...@@ -105,8 +105,8 @@ ltree_in(PG_FUNCTION_ARGS) ...@@ -105,8 +105,8 @@ ltree_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_NAME_TOO_LONG), (errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"), errmsg("name of level is too long"),
errdetail("name length is %d, must " \ errdetail("name length is %d, must " \
"be < 256, in position %d", "be < 256, in position %d",
lptr->len, (int) (lptr->start - buf)))); lptr->len, (int) (lptr->start - buf))));
totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE); totallen += MAXALIGN(lptr->len + LEVEL_HDRSIZE);
lptr++; lptr++;
...@@ -283,8 +283,8 @@ lquery_in(PG_FUNCTION_ARGS) ...@@ -283,8 +283,8 @@ lquery_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_NAME_TOO_LONG), (errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"), errmsg("name of level is too long"),
errdetail("name length is %d, must " \ errdetail("name length is %d, must " \
"be < 256, in position %d", "be < 256, in position %d",
lptr->len, (int) (lptr->start - buf)))); lptr->len, (int) (lptr->start - buf))));
state = LQPRS_WAITVAR; state = LQPRS_WAITVAR;
} }
...@@ -299,8 +299,8 @@ lquery_in(PG_FUNCTION_ARGS) ...@@ -299,8 +299,8 @@ lquery_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_NAME_TOO_LONG), (errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"), errmsg("name of level is too long"),
errdetail("name length is %d, must " \ errdetail("name length is %d, must " \
"be < 256, in position %d", "be < 256, in position %d",
lptr->len, (int) (lptr->start - buf)))); lptr->len, (int) (lptr->start - buf))));
state = LQPRS_WAITLEVEL; state = LQPRS_WAITLEVEL;
curqlevel = NEXTLEV(curqlevel); curqlevel = NEXTLEV(curqlevel);
...@@ -412,8 +412,8 @@ lquery_in(PG_FUNCTION_ARGS) ...@@ -412,8 +412,8 @@ lquery_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_NAME_TOO_LONG), (errcode(ERRCODE_NAME_TOO_LONG),
errmsg("name of level is too long"), errmsg("name of level is too long"),
errdetail("name length is %d, must " \ errdetail("name length is %d, must " \
"be < 256, in position %d", "be < 256, in position %d",
lptr->len, (int) (lptr->start - buf)))); lptr->len, (int) (lptr->start - buf))));
} }
else if (state == LQPRS_WAITOPEN) else if (state == LQPRS_WAITOPEN)
curqlevel->high = 0xffff; curqlevel->high = 0xffff;
...@@ -442,7 +442,7 @@ lquery_in(PG_FUNCTION_ARGS) ...@@ -442,7 +442,7 @@ lquery_in(PG_FUNCTION_ARGS)
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
errmsg("syntax error"), errmsg("syntax error"),
errdetail("Low limit(%d) is greater than upper(%d).", errdetail("Low limit(%d) is greater than upper(%d).",
curqlevel->low, curqlevel->high))); curqlevel->low, curqlevel->high)));
curqlevel = NEXTLEV(curqlevel); curqlevel = NEXTLEV(curqlevel);
} }
......
...@@ -83,49 +83,49 @@ Datum ...@@ -83,49 +83,49 @@ Datum
ltree_cmp(PG_FUNCTION_ARGS) ltree_cmp(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_INT32(res); PG_RETURN_INT32(res);
} }
Datum Datum
ltree_lt(PG_FUNCTION_ARGS) ltree_lt(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_BOOL((res < 0) ? true : false); PG_RETURN_BOOL((res < 0) ? true : false);
} }
Datum Datum
ltree_le(PG_FUNCTION_ARGS) ltree_le(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_BOOL((res <= 0) ? true : false); PG_RETURN_BOOL((res <= 0) ? true : false);
} }
Datum Datum
ltree_eq(PG_FUNCTION_ARGS) ltree_eq(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_BOOL((res == 0) ? true : false); PG_RETURN_BOOL((res == 0) ? true : false);
} }
Datum Datum
ltree_ge(PG_FUNCTION_ARGS) ltree_ge(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_BOOL((res >= 0) ? true : false); PG_RETURN_BOOL((res >= 0) ? true : false);
} }
Datum Datum
ltree_gt(PG_FUNCTION_ARGS) ltree_gt(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_BOOL((res > 0) ? true : false); PG_RETURN_BOOL((res > 0) ? true : false);
} }
Datum Datum
ltree_ne(PG_FUNCTION_ARGS) ltree_ne(PG_FUNCTION_ARGS)
{ {
RUNCMP RUNCMP
PG_RETURN_BOOL((res != 0) ? true : false); PG_RETURN_BOOL((res != 0) ? true : false);
} }
Datum Datum
...@@ -331,46 +331,55 @@ ltree_index(PG_FUNCTION_ARGS) ...@@ -331,46 +331,55 @@ ltree_index(PG_FUNCTION_ARGS)
{ {
ltree *a = PG_GETARG_LTREE(0); ltree *a = PG_GETARG_LTREE(0);
ltree *b = PG_GETARG_LTREE(1); ltree *b = PG_GETARG_LTREE(1);
int start=(fcinfo->nargs == 3) ? PG_GETARG_INT32(2) : 0; int start = (fcinfo->nargs == 3) ? PG_GETARG_INT32(2) : 0;
int i,j; int i,
ltree_level *startptr, *aptr, *bptr; j;
bool found=false; ltree_level *startptr,
*aptr,
if ( start < 0 ) { *bptr;
if ( -start >= a->numlevel ) bool found = false;
start=0;
else if (start < 0)
start = (int)(a->numlevel)+start; {
if (-start >= a->numlevel)
start = 0;
else
start = (int) (a->numlevel) + start;
} }
if ( a->numlevel - start < b->numlevel || a->numlevel==0 || b->numlevel==0 ) { if (a->numlevel - start < b->numlevel || a->numlevel == 0 || b->numlevel == 0)
{
PG_FREE_IF_COPY(a, 0); PG_FREE_IF_COPY(a, 0);
PG_FREE_IF_COPY(b, 1); PG_FREE_IF_COPY(b, 1);
PG_RETURN_INT32(-1); PG_RETURN_INT32(-1);
} }
startptr=LTREE_FIRST(a); startptr = LTREE_FIRST(a);
for(i=0; i<=a->numlevel-b->numlevel; i++) { for (i = 0; i <= a->numlevel - b->numlevel; i++)
if ( i>=start ) { {
aptr=startptr; if (i >= start)
bptr=LTREE_FIRST(b); {
for(j=0;j<b->numlevel;j++) { aptr = startptr;
if ( !(aptr->len==bptr->len && strncmp(aptr->name,bptr->name, aptr->len)==0) ) bptr = LTREE_FIRST(b);
break; for (j = 0; j < b->numlevel; j++)
aptr=LEVEL_NEXT(aptr); {
bptr=LEVEL_NEXT(bptr); if (!(aptr->len == bptr->len && strncmp(aptr->name, bptr->name, aptr->len) == 0))
break;
aptr = LEVEL_NEXT(aptr);
bptr = LEVEL_NEXT(bptr);
} }
if ( j==b->numlevel ) { if (j == b->numlevel)
found=true; {
found = true;
break; break;
} }
} }
startptr=LEVEL_NEXT(startptr); startptr = LEVEL_NEXT(startptr);
} }
if ( !found ) if (!found)
i=-1; i = -1;
PG_FREE_IF_COPY(a, 0); PG_FREE_IF_COPY(a, 0);
PG_FREE_IF_COPY(b, 1); PG_FREE_IF_COPY(b, 1);
...@@ -496,18 +505,18 @@ Datum ...@@ -496,18 +505,18 @@ Datum
text2ltree(PG_FUNCTION_ARGS) text2ltree(PG_FUNCTION_ARGS)
{ {
text *in = PG_GETARG_TEXT_P(0); text *in = PG_GETARG_TEXT_P(0);
char *s = (char *) palloc(VARSIZE(in) - VARHDRSZ + 1); char *s = (char *) palloc(VARSIZE(in) - VARHDRSZ + 1);
ltree *out; ltree *out;
memcpy(s, VARDATA(in), VARSIZE(in) - VARHDRSZ); memcpy(s, VARDATA(in), VARSIZE(in) - VARHDRSZ);
s[VARSIZE(in) - VARHDRSZ] = '\0'; s[VARSIZE(in) - VARHDRSZ] = '\0';
out = (ltree *) DatumGetPointer(DirectFunctionCall1( out = (ltree *) DatumGetPointer(DirectFunctionCall1(
ltree_in, ltree_in,
PointerGetDatum(s) PointerGetDatum(s)
)); ));
pfree(s); pfree(s);
PG_FREE_IF_COPY(in,0); PG_FREE_IF_COPY(in, 0);
PG_RETURN_POINTER(out); PG_RETURN_POINTER(out);
} }
...@@ -516,16 +525,18 @@ Datum ...@@ -516,16 +525,18 @@ Datum
ltree2text(PG_FUNCTION_ARGS) ltree2text(PG_FUNCTION_ARGS)
{ {
ltree *in = PG_GETARG_LTREE(0); ltree *in = PG_GETARG_LTREE(0);
char *ptr; char *ptr;
int i; int i;
ltree_level *curlevel; ltree_level *curlevel;
text *out; text *out;
out=(text*)palloc(in->len+VARHDRSZ); out = (text *) palloc(in->len + VARHDRSZ);
ptr = VARDATA(out); ptr = VARDATA(out);
curlevel = LTREE_FIRST(in); curlevel = LTREE_FIRST(in);
for (i = 0; i < in->numlevel; i++) { for (i = 0; i < in->numlevel; i++)
if (i != 0) { {
if (i != 0)
{
*ptr = '.'; *ptr = '.';
ptr++; ptr++;
} }
...@@ -533,13 +544,9 @@ ltree2text(PG_FUNCTION_ARGS) ...@@ -533,13 +544,9 @@ ltree2text(PG_FUNCTION_ARGS)
ptr += curlevel->len; ptr += curlevel->len;
curlevel = LEVEL_NEXT(curlevel); curlevel = LEVEL_NEXT(curlevel);
} }
VARATT_SIZEP(out) = VARHDRSZ + (ptr-VARDATA(out)); VARATT_SIZEP(out) = VARHDRSZ + (ptr - VARDATA(out));
PG_FREE_IF_COPY(in, 0); PG_FREE_IF_COPY(in, 0);
PG_RETURN_POINTER(out); PG_RETURN_POINTER(out);
} }
...@@ -356,8 +356,8 @@ sql_exec_dumptable(PGconn *conn, int systables) ...@@ -356,8 +356,8 @@ sql_exec_dumptable(PGconn *conn, int systables)
snprintf(todo, 1024, "select relfilenode,relname from pg_class order by relname"); snprintf(todo, 1024, "select relfilenode,relname from pg_class order by relname");
else else
snprintf(todo, 1024, "select relfilenode,relname from pg_class " snprintf(todo, 1024, "select relfilenode,relname from pg_class "
"where relkind not in ('v','s', 'c') and " "where relkind not in ('v','s', 'c') and "
"relname not like 'pg_%%' order by relname"); "relname not like 'pg_%%' order by relname");
sql_exec(conn, todo, 0); sql_exec(conn, todo, 0);
} }
......
This diff is collapsed.
...@@ -23,19 +23,19 @@ ...@@ -23,19 +23,19 @@
#include "/usr/include/pgsql/server/lib/dllist.h" #include "/usr/include/pgsql/server/lib/dllist.h"
*/ */
#define AUTOVACUUM_DEBUG 1 #define AUTOVACUUM_DEBUG 1
#define VACBASETHRESHOLD 1000 #define VACBASETHRESHOLD 1000
#define VACSCALINGFACTOR 2 #define VACSCALINGFACTOR 2
#define SLEEPBASEVALUE 300 #define SLEEPBASEVALUE 300
#define SLEEPSCALINGFACTOR 2 #define SLEEPSCALINGFACTOR 2
#define UPDATE_INTERVAL 2 #define UPDATE_INTERVAL 2
/* these two constants are used to tell update_table_stats what operation we just perfomred */ /* these two constants are used to tell update_table_stats what operation we just perfomred */
#define VACUUM_ANALYZE 0 #define VACUUM_ANALYZE 0
#define ANALYZE_ONLY 1 #define ANALYZE_ONLY 1
#define TABLE_STATS_ALL "select a.relfilenode,a.relname,a.relnamespace,a.relpages,a.reltuples,b.schemaname,b.n_tup_ins,b.n_tup_upd,b.n_tup_del from pg_class a, pg_stat_all_tables b where a.relfilenode=b.relid" #define TABLE_STATS_ALL "select a.relfilenode,a.relname,a.relnamespace,a.relpages,a.reltuples,b.schemaname,b.n_tup_ins,b.n_tup_upd,b.n_tup_del from pg_class a, pg_stat_all_tables b where a.relfilenode=b.relid"
#define TABLE_STATS_USER "select a.relfilenode,a.relname,a.relnamespace,a.relpages,a.reltuples,b.schemaname,b.n_tup_ins,b.n_tup_upd,b.n_tup_del from pg_class a, pg_stat_user_tables b where a.relfilenode=b.relid" #define TABLE_STATS_USER "select a.relfilenode,a.relname,a.relnamespace,a.relpages,a.reltuples,b.schemaname,b.n_tup_ins,b.n_tup_upd,b.n_tup_del from pg_class a, pg_stat_user_tables b where a.relfilenode=b.relid"
#define FRONTEND #define FRONTEND
#define PAGES_QUERY "select relfilenode,reltuples,relpages from pg_class where relfilenode=%i" #define PAGES_QUERY "select relfilenode,reltuples,relpages from pg_class where relfilenode=%i"
#define FROZENOID_QUERY "select oid,age(datfrozenxid) from pg_database where datname = 'template1'" #define FROZENOID_QUERY "select oid,age(datfrozenxid) from pg_database where datname = 'template1'"
...@@ -44,71 +44,96 @@ ...@@ -44,71 +44,96 @@
/* define cmd_args stucture */ /* define cmd_args stucture */
struct cmdargs struct cmdargs
{ {
int vacuum_base_threshold, analyze_base_threshold, sleep_base_value, debug, daemonize; int vacuum_base_threshold,
float vacuum_scaling_factor, analyze_scaling_factor, sleep_scaling_factor; analyze_base_threshold,
char *user, *password, *host, *logfile, *port; sleep_base_value,
debug,
daemonize;
float vacuum_scaling_factor,
analyze_scaling_factor,
sleep_scaling_factor;
char *user,
*password,
*host,
*logfile,
*port;
}; };
typedef struct cmdargs cmd_args; typedef struct cmdargs cmd_args;
/* define cmd_args as global so we can get to them everywhere */ /* define cmd_args as global so we can get to them everywhere */
cmd_args *args; cmd_args *args;
/* Might need to add a time value for last time the whold database was vacuumed. /* Might need to add a time value for last time the whold database was vacuumed.
I think we need to guarantee this happens approx every 1Million TX's */ I think we need to guarantee this happens approx every 1Million TX's */
struct dbinfo struct dbinfo
{ {
int oid, age; int oid,
int analyze_threshold, vacuum_threshold; /* Use these as defaults for table thresholds */ age;
PGconn *conn; int analyze_threshold,
char *dbname, *username, *password; vacuum_threshold; /* Use these as defaults for table
Dllist *table_list; * thresholds */
PGconn *conn;
char *dbname,
*username,
*password;
Dllist *table_list;
}; };
typedef struct dbinfo db_info; typedef struct dbinfo db_info;
struct tableinfo struct tableinfo
{ {
char *schema_name, *table_name; char *schema_name,
int relfilenode, reltuples, relpages; *table_name;
long analyze_threshold, vacuum_threshold; int relfilenode,
long CountAtLastAnalyze; /* equal to: inserts + updates as of the last analyze or initial values at startup */ reltuples,
long CountAtLastVacuum; /* equal to: deletes + updates as of the last vacuum or initial values at startup */ relpages;
long curr_analyze_count, curr_vacuum_count; /* Latest values from stats system */ long analyze_threshold,
db_info *dbi; /* pointer to the database that this table belongs to */ vacuum_threshold;
long CountAtLastAnalyze; /* equal to: inserts + updates as
* of the last analyze or initial
* values at startup */
long CountAtLastVacuum; /* equal to: deletes + updates as
* of the last vacuum or initial
* values at startup */
long curr_analyze_count,
curr_vacuum_count; /* Latest values from stats system */
db_info *dbi; /* pointer to the database that this table
* belongs to */
}; };
typedef struct tableinfo tbl_info; typedef struct tableinfo tbl_info;
/* Functions for dealing with command line arguements */ /* Functions for dealing with command line arguements */
static cmd_args *get_cmd_args (int argc, char *argv[]); static cmd_args *get_cmd_args(int argc, char *argv[]);
static void print_cmd_args (void); static void print_cmd_args(void);
static void free_cmd_args (void); static void free_cmd_args(void);
static void usage (void); static void usage(void);
/* Functions for managing database lists */ /* Functions for managing database lists */
static Dllist *init_db_list (void); static Dllist *init_db_list(void);
static db_info *init_dbinfo (char *dbname, int oid, int age); static db_info *init_dbinfo(char *dbname, int oid, int age);
static void update_db_list (Dllist * db_list); static void update_db_list(Dllist *db_list);
static void remove_db_from_list (Dlelem * db_to_remove); static void remove_db_from_list(Dlelem *db_to_remove);
static void print_db_info (db_info * dbi, int print_table_list); static void print_db_info(db_info * dbi, int print_table_list);
static void print_db_list (Dllist * db_list, int print_table_lists); static void print_db_list(Dllist *db_list, int print_table_lists);
static int xid_wraparound_check (db_info * dbi); static int xid_wraparound_check(db_info * dbi);
static void free_db_list (Dllist * db_list); static void free_db_list(Dllist *db_list);
/* Functions for managing table lists */ /* Functions for managing table lists */
static tbl_info *init_table_info (PGresult * conn, int row, db_info *dbi); static tbl_info *init_table_info(PGresult *conn, int row, db_info * dbi);
static void update_table_list (db_info * dbi); static void update_table_list(db_info * dbi);
static void remove_table_from_list (Dlelem * tbl_to_remove); static void remove_table_from_list(Dlelem *tbl_to_remove);
static void print_table_list (Dllist * tbl_node); static void print_table_list(Dllist *tbl_node);
static void print_table_info (tbl_info * tbl); static void print_table_info(tbl_info * tbl);
static void update_table_thresholds (db_info * dbi, tbl_info * tbl, int vacuum_type); static void update_table_thresholds(db_info * dbi, tbl_info * tbl, int vacuum_type);
static void free_tbl_list (Dllist * tbl_list); static void free_tbl_list(Dllist *tbl_list);
/* A few database helper functions */ /* A few database helper functions */
static int check_stats_enabled (db_info * dbi); static int check_stats_enabled(db_info * dbi);
static PGconn *db_connect (db_info * dbi); static PGconn *db_connect(db_info * dbi);
static void db_disconnect (db_info * dbi); static void db_disconnect(db_info * dbi);
static PGresult *send_query (const char *query, db_info * dbi); static PGresult *send_query(const char *query, db_info * dbi);
static char *query_table_stats (db_info * dbi); static char *query_table_stats(db_info * dbi);
/* Other Generally needed Functions */ /* Other Generally needed Functions */
static void daemonize(void); static void daemonize(void);
static void log_entry (const char *logentry); static void log_entry(const char *logentry);
/* ------------------------------------------------------------------------- /* -------------------------------------------------------------------------
* pg_dumplo * pg_dumplo
* *
* $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.16 2003/05/14 03:25:56 tgl Exp $ * $Header: /cvsroot/pgsql/contrib/pg_dumplo/Attic/main.c,v 1.17 2003/08/04 00:43:11 momjian Exp $
* *
* Karel Zak 1999-2000 * Karel Zak 1999-2000
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#ifndef HAVE_GETOPT_LONG #ifndef HAVE_GETOPT_LONG
#include "getopt_long.h" #include "getopt_long.h"
int optreset; int optreset;
#endif #endif
char *progname = NULL; char *progname = NULL;
......
/* /*
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.25 2003/08/01 02:21:17 tgl Exp $ * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.26 2003/08/04 00:43:11 momjian Exp $
* *
* pgbench: a simple TPC-B like benchmark program for PostgreSQL * pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii * written by Tatsuo Ishii
...@@ -122,7 +122,7 @@ doConnect() ...@@ -122,7 +122,7 @@ doConnect()
{ {
PGconn *con; PGconn *con;
PGresult *res; PGresult *res;
con = PQsetdbLogin(pghost, pgport, pgoptions, pgtty, dbName, con = PQsetdbLogin(pghost, pgport, pgoptions, pgtty, dbName,
login, pwd); login, pwd);
if (con == NULL) if (con == NULL)
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: openssl.c,v 1.11 2002/11/15 02:54:44 momjian Exp $ * $Id: openssl.c,v 1.12 2003/08/04 00:43:11 momjian Exp $
*/ */
#include <postgres.h> #include <postgres.h>
...@@ -130,18 +130,19 @@ px_find_digest(const char *name, PX_MD ** res) ...@@ -130,18 +130,19 @@ px_find_digest(const char *name, PX_MD ** res)
* of functions does not allow enough flexibility * of functions does not allow enough flexibility
* and forces some of the parameters (keylen, * and forces some of the parameters (keylen,
* padding) to SSL defaults. * padding) to SSL defaults.
* *
* So need to manage ciphers ourselves. * So need to manage ciphers ourselves.
*/ */
struct ossl_cipher { struct ossl_cipher
int (*init) (PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv); {
int (*encrypt) (PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res); int (*init) (PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv);
int (*decrypt) (PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res); int (*encrypt) (PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res);
int (*decrypt) (PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res);
int block_size; int block_size;
int max_key_size; int max_key_size;
int stream_cipher; int stream_cipher;
}; };
typedef struct typedef struct
...@@ -224,7 +225,7 @@ static int ...@@ -224,7 +225,7 @@ static int
bf_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res) bf_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *res)
{ {
unsigned bs = gen_ossl_block_size(c); unsigned bs = gen_ossl_block_size(c);
unsigned i; unsigned i;
ossldata *od = c->ptr; ossldata *od = c->ptr;
for (i = 0; i < dlen / bs; i++) for (i = 0; i < dlen / bs; i++)
...@@ -288,13 +289,13 @@ static int ...@@ -288,13 +289,13 @@ static int
ossl_des_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv) ossl_des_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
{ {
ossldata *od = c->ptr; ossldata *od = c->ptr;
des_cblock xkey; des_cblock xkey;
memset(&xkey, 0, sizeof(xkey)); memset(&xkey, 0, sizeof(xkey));
memcpy(&xkey, key, klen > 8 ? 8 : klen); memcpy(&xkey, key, klen > 8 ? 8 : klen);
des_set_key(&xkey, od->u.des.key_schedule); des_set_key(&xkey, od->u.des.key_schedule);
memset(&xkey, 0, sizeof(xkey)); memset(&xkey, 0, sizeof(xkey));
if (iv) if (iv)
memcpy(od->iv, iv, 8); memcpy(od->iv, iv, 8);
else else
...@@ -304,53 +305,53 @@ ossl_des_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv) ...@@ -304,53 +305,53 @@ ossl_des_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
static int static int
ossl_des_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, ossl_des_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
uint8 *res) uint8 *res)
{ {
unsigned bs = gen_ossl_block_size(c); unsigned bs = gen_ossl_block_size(c);
unsigned i; unsigned i;
ossldata *od = c->ptr; ossldata *od = c->ptr;
for (i = 0; i < dlen / bs; i++) for (i = 0; i < dlen / bs; i++)
des_ecb_encrypt((des_cblock*)(data + i * bs), des_ecb_encrypt((des_cblock *) (data + i * bs),
(des_cblock*)(res + i * bs), (des_cblock *) (res + i * bs),
od->u.des.key_schedule, 1); od->u.des.key_schedule, 1);
return 0; return 0;
} }
static int static int
ossl_des_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, ossl_des_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
uint8 *res) uint8 *res)
{ {
unsigned bs = gen_ossl_block_size(c); unsigned bs = gen_ossl_block_size(c);
unsigned i; unsigned i;
ossldata *od = c->ptr; ossldata *od = c->ptr;
for (i = 0; i < dlen / bs; i++) for (i = 0; i < dlen / bs; i++)
des_ecb_encrypt((des_cblock*)(data + i * bs), des_ecb_encrypt((des_cblock *) (data + i * bs),
(des_cblock*)(res + i * bs), (des_cblock *) (res + i * bs),
od->u.des.key_schedule, 0); od->u.des.key_schedule, 0);
return 0; return 0;
} }
static int static int
ossl_des_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, ossl_des_cbc_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
uint8 *res) uint8 *res)
{ {
ossldata *od = c->ptr; ossldata *od = c->ptr;
des_ncbc_encrypt(data, res, dlen, od->u.des.key_schedule, des_ncbc_encrypt(data, res, dlen, od->u.des.key_schedule,
(des_cblock*)od->iv, 1); (des_cblock *) od->iv, 1);
return 0; return 0;
} }
static int static int
ossl_des_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, ossl_des_cbc_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen,
uint8 *res) uint8 *res)
{ {
ossldata *od = c->ptr; ossldata *od = c->ptr;
des_ncbc_encrypt(data, res, dlen, od->u.des.key_schedule, des_ncbc_encrypt(data, res, dlen, od->u.des.key_schedule,
(des_cblock*)od->iv, 0); (des_cblock *) od->iv, 0);
return 0; return 0;
} }
...@@ -375,7 +376,7 @@ ossl_cast_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re ...@@ -375,7 +376,7 @@ ossl_cast_ecb_encrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re
{ {
unsigned bs = gen_ossl_block_size(c); unsigned bs = gen_ossl_block_size(c);
ossldata *od = c->ptr; ossldata *od = c->ptr;
const uint8 *end = data + dlen - bs; const uint8 *end = data + dlen - bs;
for (; data <= end; data += bs, res += bs) for (; data <= end; data += bs, res += bs)
CAST_ecb_encrypt(data, res, &od->u.cast_key, CAST_ENCRYPT); CAST_ecb_encrypt(data, res, &od->u.cast_key, CAST_ENCRYPT);
...@@ -387,7 +388,7 @@ ossl_cast_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re ...@@ -387,7 +388,7 @@ ossl_cast_ecb_decrypt(PX_Cipher * c, const uint8 *data, unsigned dlen, uint8 *re
{ {
unsigned bs = gen_ossl_block_size(c); unsigned bs = gen_ossl_block_size(c);
ossldata *od = c->ptr; ossldata *od = c->ptr;
const uint8 *end = data + dlen - bs; const uint8 *end = data + dlen - bs;
for (; data <= end; data += bs, res += bs) for (; data <= end; data += bs, res += bs)
CAST_ecb_encrypt(data, res, &od->u.cast_key, CAST_DECRYPT); CAST_ecb_encrypt(data, res, &od->u.cast_key, CAST_DECRYPT);
...@@ -429,37 +430,37 @@ static PX_Alias ossl_aliases[] = { ...@@ -429,37 +430,37 @@ static PX_Alias ossl_aliases[] = {
static const struct ossl_cipher ossl_bf_cbc = { static const struct ossl_cipher ossl_bf_cbc = {
bf_init, bf_cbc_encrypt, bf_cbc_decrypt, bf_init, bf_cbc_encrypt, bf_cbc_decrypt,
64/8, 448/8, 0 64 / 8, 448 / 8, 0
}; };
static const struct ossl_cipher ossl_bf_ecb = { static const struct ossl_cipher ossl_bf_ecb = {
bf_init, bf_ecb_encrypt, bf_ecb_decrypt, bf_init, bf_ecb_encrypt, bf_ecb_decrypt,
64/8, 448/8, 0 64 / 8, 448 / 8, 0
}; };
static const struct ossl_cipher ossl_bf_cfb = { static const struct ossl_cipher ossl_bf_cfb = {
bf_init, bf_cfb64_encrypt, bf_cfb64_decrypt, bf_init, bf_cfb64_encrypt, bf_cfb64_decrypt,
64/8, 448/8, 1 64 / 8, 448 / 8, 1
}; };
static const struct ossl_cipher ossl_des_ecb = { static const struct ossl_cipher ossl_des_ecb = {
ossl_des_init, ossl_des_ecb_encrypt, ossl_des_ecb_decrypt, ossl_des_init, ossl_des_ecb_encrypt, ossl_des_ecb_decrypt,
64/8, 64/8, 0 64 / 8, 64 / 8, 0
}; };
static const struct ossl_cipher ossl_des_cbc = { static const struct ossl_cipher ossl_des_cbc = {
ossl_des_init, ossl_des_cbc_encrypt, ossl_des_cbc_decrypt, ossl_des_init, ossl_des_cbc_encrypt, ossl_des_cbc_decrypt,
64/8, 64/8, 0 64 / 8, 64 / 8, 0
}; };
static const struct ossl_cipher ossl_cast_ecb = { static const struct ossl_cipher ossl_cast_ecb = {
ossl_cast_init, ossl_cast_ecb_encrypt, ossl_cast_ecb_decrypt, ossl_cast_init, ossl_cast_ecb_encrypt, ossl_cast_ecb_decrypt,
64/8, 128/8, 0 64 / 8, 128 / 8, 0
}; };
static const struct ossl_cipher ossl_cast_cbc = { static const struct ossl_cipher ossl_cast_cbc = {
ossl_cast_init, ossl_cast_cbc_encrypt, ossl_cast_cbc_decrypt, ossl_cast_init, ossl_cast_cbc_encrypt, ossl_cast_cbc_decrypt,
64/8, 128/8, 0 64 / 8, 128 / 8, 0
}; };
/* /*
...@@ -467,7 +468,7 @@ static const struct ossl_cipher ossl_cast_cbc = { ...@@ -467,7 +468,7 @@ static const struct ossl_cipher ossl_cast_cbc = {
*/ */
static const struct static const struct
{ {
const char *name; const char *name;
const struct ossl_cipher *ciph; const struct ossl_cipher *ciph;
} ossl_cipher_types[] = } ossl_cipher_types[] =
...@@ -510,8 +511,10 @@ px_find_cipher(const char *name, PX_Cipher ** res) ...@@ -510,8 +511,10 @@ px_find_cipher(const char *name, PX_Cipher ** res)
const struct ossl_cipher *ossl_ciph = NULL; const struct ossl_cipher *ossl_ciph = NULL;
name = px_resolve_alias(ossl_aliases, name); name = px_resolve_alias(ossl_aliases, name);
for (i = 0; ossl_cipher_types[i].name; i++) { for (i = 0; ossl_cipher_types[i].name; i++)
if (!strcmp(ossl_cipher_types[i].name, name)) { {
if (!strcmp(ossl_cipher_types[i].name, name))
{
ossl_ciph = ossl_cipher_types[i].ciph; ossl_ciph = ossl_cipher_types[i].ciph;
break; break;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: pgcrypto.c,v 1.13 2003/07/24 17:52:33 tgl Exp $ * $Id: pgcrypto.c,v 1.14 2003/08/04 00:43:11 momjian Exp $
*/ */
#include <postgres.h> #include <postgres.h>
...@@ -241,7 +241,7 @@ pg_gen_salt_rounds(PG_FUNCTION_ARGS) ...@@ -241,7 +241,7 @@ pg_gen_salt_rounds(PG_FUNCTION_ARGS)
if (len == 0) if (len == 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("no such crypt algorithm or bad number of rounds"))); errmsg("no such crypt algorithm or bad number of rounds")));
res = (text *) palloc(len + VARHDRSZ); res = (text *) palloc(len + VARHDRSZ);
VARATT_SIZEP(res) = len + VARHDRSZ; VARATT_SIZEP(res) = len + VARHDRSZ;
......
/* /*
* $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.11 2003/08/01 02:21:17 tgl Exp $ * $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.12 2003/08/04 00:43:11 momjian Exp $
* *
* Copyright (c) 2001,2002 Tatsuo Ishii * Copyright (c) 2001,2002 Tatsuo Ishii
* *
...@@ -221,5 +221,5 @@ pgstattuple_real(Relation rel) ...@@ -221,5 +221,5 @@ pgstattuple_real(Relation rel)
pfree(values[i]); pfree(values[i]);
pfree(values); pfree(values);
return(result); return (result);
} }
...@@ -73,8 +73,8 @@ autoinc(PG_FUNCTION_ARGS) ...@@ -73,8 +73,8 @@ autoinc(PG_FUNCTION_ARGS)
if (SPI_gettypeid(tupdesc, attnum) != INT4OID) if (SPI_gettypeid(tupdesc, attnum) != INT4OID)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
errmsg("attribute \"%s\" of \"%s\" must be type INT4", errmsg("attribute \"%s\" of \"%s\" must be type INT4",
args[i], relname))); args[i], relname)));
val = DatumGetInt32(SPI_getbinval(rettuple, tupdesc, attnum, &isnull)); val = DatumGetInt32(SPI_getbinval(rettuple, tupdesc, attnum, &isnull));
......
...@@ -65,17 +65,17 @@ insert_username(PG_FUNCTION_ARGS) ...@@ -65,17 +65,17 @@ insert_username(PG_FUNCTION_ARGS)
if (attnum < 0) if (attnum < 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
errmsg("\"%s\" has no attribute \"%s\"", relname, args[0]))); errmsg("\"%s\" has no attribute \"%s\"", relname, args[0])));
if (SPI_gettypeid(tupdesc, attnum) != TEXTOID) if (SPI_gettypeid(tupdesc, attnum) != TEXTOID)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
errmsg("attribute \"%s\" of \"%s\" must be type TEXT", errmsg("attribute \"%s\" of \"%s\" must be type TEXT",
args[0], relname))); args[0], relname)));
/* create fields containing name */ /* create fields containing name */
newval = DirectFunctionCall1(textin, newval = DirectFunctionCall1(textin,
CStringGetDatum(GetUserNameFromId(GetUserId()))); CStringGetDatum(GetUserNameFromId(GetUserId())));
/* construct new tuple */ /* construct new tuple */
rettuple = SPI_modifytuple(rel, rettuple, 1, &attnum, &newval, NULL); rettuple = SPI_modifytuple(rel, rettuple, 1, &attnum, &newval, NULL);
......
...@@ -100,8 +100,8 @@ moddatetime(PG_FUNCTION_ARGS) ...@@ -100,8 +100,8 @@ moddatetime(PG_FUNCTION_ARGS)
if (SPI_gettypeid(tupdesc, attnum) != TIMESTAMPOID) if (SPI_gettypeid(tupdesc, attnum) != TIMESTAMPOID)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
errmsg("attribute \"%s\" of \"%s\" must be type TIMESTAMP", errmsg("attribute \"%s\" of \"%s\" must be type TIMESTAMP",
args[0], relname))); args[0], relname)));
/* 1 is the number of items in the arrays attnum and newdt. /* 1 is the number of items in the arrays attnum and newdt.
attnum is the positional number of the field to be updated. attnum is the positional number of the field to be updated.
......
...@@ -134,8 +134,8 @@ check_primary_key(PG_FUNCTION_ARGS) ...@@ -134,8 +134,8 @@ check_primary_key(PG_FUNCTION_ARGS)
if (fnumber < 0) if (fnumber < 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN), (errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("there is no attribute \"%s\" in relation \"%s\"", errmsg("there is no attribute \"%s\" in relation \"%s\"",
args[i], SPI_getrelname(rel)))); args[i], SPI_getrelname(rel))));
/* Well, get binary (in internal format) value of column */ /* Well, get binary (in internal format) value of column */
kvals[i] = SPI_getbinval(tuple, tupdesc, fnumber, &isnull); kvals[i] = SPI_getbinval(tuple, tupdesc, fnumber, &isnull);
...@@ -365,8 +365,8 @@ check_foreign_key(PG_FUNCTION_ARGS) ...@@ -365,8 +365,8 @@ check_foreign_key(PG_FUNCTION_ARGS)
if (fnumber < 0) if (fnumber < 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_COLUMN), (errcode(ERRCODE_UNDEFINED_COLUMN),
errmsg("there is no attribute \"%s\" in relation \"%s\"", errmsg("there is no attribute \"%s\" in relation \"%s\"",
args[i], SPI_getrelname(rel)))); args[i], SPI_getrelname(rel))));
/* Well, get binary (in internal format) value of column */ /* Well, get binary (in internal format) value of column */
kvals[i] = SPI_getbinval(trigtuple, tupdesc, fnumber, &isnull); kvals[i] = SPI_getbinval(trigtuple, tupdesc, fnumber, &isnull);
...@@ -591,7 +591,7 @@ check_foreign_key(PG_FUNCTION_ARGS) ...@@ -591,7 +591,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION), (errcode(ERRCODE_TRIGGERED_ACTION_EXCEPTION),
errmsg("\"%s\": tuple is referenced in \"%s\"", errmsg("\"%s\": tuple is referenced in \"%s\"",
trigger->tgname, relname))); trigger->tgname, relname)));
} }
else else
{ {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* This file was generated automatically by the Snowball to ANSI C compiler */ /* This file was generated automatically by the Snowball to ANSI C compiler */
extern struct SN_env * english_create_env(void); extern struct SN_env *english_create_env(void);
extern void english_close_env(struct SN_env * z); extern void english_close_env(struct SN_env * z);
extern int english_stem(struct SN_env * z); extern int english_stem(struct SN_env * z);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment