Commit 7c3b7d27 authored by Marc G. Fournier's avatar Marc G. Fournier

Initial attempt to clean up the code...

Switch sprintf() to snprintf()
Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of
	code
parent f722af61
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.45 1998/11/27 19:51:28 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.46 1998/12/14 05:18:30 scrappy Exp $
* *
* NOTES * NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be * some of the executor utility code such as "ExecTypeFromTL" should be
...@@ -488,7 +488,8 @@ BuildDescForRelation(List *schema, char *relname) ...@@ -488,7 +488,8 @@ BuildDescForRelation(List *schema, char *relname)
if (arry != NIL) if (arry != NIL)
{ {
/* array of XXX is _XXX */ /* array of XXX is _XXX */
sprintf(typename, "_%.*s", NAMEDATALEN - 2, entry->typename->name); snprintf(typename, NAMEDATALEN,
"_%.*s", NAMEDATALEN - 2, entry->typename->name);
attdim = length(arry); attdim = length(arry);
} }
else else
......
...@@ -1326,34 +1326,6 @@ _gistdump(Relation r) ...@@ -1326,34 +1326,6 @@ _gistdump(Relation r)
} }
} }
#ifdef NOT_USED
static char *
text_range_out(TXTRANGE *r)
{
char *result;
char *lower,
*upper;
if (r == NULL)
return NULL;
result = (char *) palloc(NAMEDATALEN + VARSIZE(TRLOWER(r)) + VARSIZE(TRUPPER(r))
- 2 * VARHDRSZ);
lower = (char *) palloc(VARSIZE(TRLOWER(r)) + 1 - VARHDRSZ);
memcpy(lower, VARDATA(TRLOWER(r)), VARSIZE(TRLOWER(r)) - VARHDRSZ);
lower[VARSIZE(TRLOWER(r)) - VARHDRSZ] = '\0';
upper = (char *) palloc(VARSIZE(TRUPPER(r)) + 1 - VARHDRSZ);
memcpy(upper, VARDATA(TRUPPER(r)), VARSIZE(TRUPPER(r)) - VARHDRSZ);
upper[VARSIZE(TRUPPER(r)) - VARHDRSZ] = '\0';
sprintf(result, "[%s,%s): %d", lower, upper, r->flag);
pfree(lower);
pfree(upper);
return result;
}
#endif
static char * static char *
int_range_out(INTRANGE *r) int_range_out(INTRANGE *r)
{ {
...@@ -1362,7 +1334,7 @@ int_range_out(INTRANGE *r) ...@@ -1362,7 +1334,7 @@ int_range_out(INTRANGE *r)
if (r == NULL) if (r == NULL)
return NULL; return NULL;
result = (char *) palloc(80); result = (char *) palloc(80);
sprintf(result, "[%d,%d): %d", r->lower, r->upper, r->flag); snprintf(result, 80, "[%d,%d): %d", r->lower, r->upper, r->flag);
return result; return result;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.18 1998/10/08 18:29:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.19 1998/12/14 05:18:33 scrappy Exp $
* *
* OLD COMMENTS * OLD COMMENTS
* XXX WARNING * XXX WARNING
...@@ -53,18 +53,6 @@ xidout(TransactionId transactionId) ...@@ -53,18 +53,6 @@ xidout(TransactionId transactionId)
} }
#ifdef NOT_USED
/* ----------------------------------------------------------------
* TransactionIdIsLessThan
* ----------------------------------------------------------------
*/
bool
TransactionIdIsLessThan(TransactionId id1, TransactionId id2)
{
return (bool) (id1 < id2);
}
#endif
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* xideq * xideq
* ---------------------------------------------------------------- * ----------------------------------------------------------------
...@@ -82,23 +70,6 @@ xideq(TransactionId xid1, TransactionId xid2) ...@@ -82,23 +70,6 @@ xideq(TransactionId xid1, TransactionId xid2)
/* ----------------------------------------------------------------
* TransactionIdIncrement
* ----------------------------------------------------------------
*/
#ifdef NOT_USED
void
TransactionIdIncrement(TransactionId *transactionId)
{
(*transactionId)++;
if (*transactionId == DisabledTransactionId)
elog(FATAL, "TransactionIdIncrement: exhausted XID's");
return;
}
#endif
/* ---------------------------------------------------------------- /* ----------------------------------------------------------------
* TransactionIdAdd * TransactionIdAdd
* ---------------------------------------------------------------- * ----------------------------------------------------------------
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.18 1998/09/01 04:27:28 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.19 1998/12/14 05:18:36 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -30,39 +30,18 @@ char * ...@@ -30,39 +30,18 @@ char *
relpath(char *relname) relpath(char *relname)
{ {
char *path; char *path;
int bufsize = 0;
if (IsSharedSystemRelationName(relname)) if (IsSharedSystemRelationName(relname))
{ {
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2); bufsize = strlen(DataDir) + sizeof(NameData) + 2;
sprintf(path, "%s/%s", DataDir, relname); path = (char *) palloc(bufsize);
snprintf(path, bufsize, "%s/%s", DataDir, relname);
return path; return path;
} }
return relname; return relname;
} }
#ifdef NOT_USED
/*
* issystem - returns non-zero iff relname is a system catalog
*
* We now make a new requirement where system catalog relns must begin
* with pg_ while user relns are forbidden to do so. Make the test
* trivial and instantaneous.
*
* XXX this is way bogus. -- pma
*/
bool
issystem(char *relname)
{
if (relname[0] && relname[1] && relname[2])
return (relname[0] == 'p' &&
relname[1] == 'g' &&
relname[2] == '_');
else
return FALSE;
}
#endif
/* /*
* IsSystemRelationName -- * IsSystemRelationName --
* True iff name is the name of a system catalog relation. * True iff name is the name of a system catalog relation.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.68 1998/12/13 23:50:58 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.69 1998/12/14 05:18:37 scrappy Exp $
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation * heap_create() - Create an uncataloged heap relation
...@@ -244,7 +244,7 @@ heap_create(char *name, ...@@ -244,7 +244,7 @@ heap_create(char *name,
if (name[0] == '\0') if (name[0] == '\0')
{ {
sprintf(tempname, "temp_%d", relid); snprintf(tempname, NAMEDATALEN, "temp_%d", relid);
Assert(strlen(tempname) < NAMEDATALEN); Assert(strlen(tempname) < NAMEDATALEN);
relname = tempname; relname = tempname;
isTemp = 1; isTemp = 1;
...@@ -1448,7 +1448,8 @@ start:; ...@@ -1448,7 +1448,8 @@ start:;
/* Surround table name with double quotes to allow mixed-case and /* Surround table name with double quotes to allow mixed-case and
* whitespaces in names. - BGA 1998-11-14 * whitespaces in names. - BGA 1998-11-14
*/ */
sprintf(str, "select %s%s from \"%.*s\"", attrdef->adsrc, cast, snprintf(str, MAX_PARSE_BUFFER,
"select %s%s from \"%.*s\"", attrdef->adsrc, cast,
NAMEDATALEN, rel->rd_rel->relname.data); NAMEDATALEN, rel->rd_rel->relname.data);
setheapoverride(true); setheapoverride(true);
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE); planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);
...@@ -1463,22 +1464,6 @@ start:; ...@@ -1463,22 +1464,6 @@ start:;
expr = te->expr; expr = te->expr;
type = exprType(expr); type = exprType(expr);
#if 0
if (IsA(expr, Const))
{
if (((Const *) expr)->consttype != atp->atttypid)
{
if (*cast != 0)
elog(ERROR, "DEFAULT: const type mismatched");
sprintf(cast, ":: %s", typeidTypeName(atp->atttypid));
goto start;
}
}
else if ((exprType(expr) != atp->atttypid)
&& !IS_BINARY_COMPATIBLE(exprType(expr), atp->atttypid))
elog(ERROR, "DEFAULT: type mismatched");
#endif
if (type != atp->atttypid) if (type != atp->atttypid)
{ {
if (IS_BINARY_COMPATIBLE(type, atp->atttypid)) if (IS_BINARY_COMPATIBLE(type, atp->atttypid))
...@@ -1490,7 +1475,7 @@ start:; ...@@ -1490,7 +1475,7 @@ start:;
if (*cast != 0) if (*cast != 0)
elog(ERROR, "DEFAULT clause const type '%s' mismatched with column type '%s'", elog(ERROR, "DEFAULT clause const type '%s' mismatched with column type '%s'",
typeidTypeName(type), typeidTypeName(atp->atttypid)); typeidTypeName(type), typeidTypeName(atp->atttypid));
sprintf(cast, ":: %s", typeidTypeName(atp->atttypid)); snprintf(cast, 2*NAMEDATALEN, ":: %s", typeidTypeName(atp->atttypid));
goto start; goto start;
} }
else else
...@@ -1544,7 +1529,8 @@ StoreRelCheck(Relation rel, ConstrCheck *check) ...@@ -1544,7 +1529,8 @@ StoreRelCheck(Relation rel, ConstrCheck *check)
/* Check for table's existance. Surround table name with double-quotes /* Check for table's existance. Surround table name with double-quotes
* to allow mixed-case and whitespace names. - thomas 1998-11-12 * to allow mixed-case and whitespace names. - thomas 1998-11-12
*/ */
sprintf(str, "select 1 from \"%.*s\" where %s", snprintf(str, MAX_PARSE_BUFFER,
"select 1 from \"%.*s\" where %s",
NAMEDATALEN, rel->rd_rel->relname.data, check->ccsrc); NAMEDATALEN, rel->rd_rel->relname.data, check->ccsrc);
setheapoverride(true); setheapoverride(true);
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE); planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.15 1998/09/01 04:28:09 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.16 1998/12/14 05:18:44 scrappy Exp $
* *
* NOTES * NOTES
* At the point the version is defined, 2 physical relations are created * At the point the version is defined, 2 physical relations are created
...@@ -37,11 +37,6 @@ ...@@ -37,11 +37,6 @@
char rule_buf[MAX_QUERY_LEN]; char rule_buf[MAX_QUERY_LEN];
#ifdef NOT_USED
static char attr_list[MAX_QUERY_LEN];
#endif
/* /*
* problem: the version system assumes that the rules it declares will * problem: the version system assumes that the rules it declares will
* be fired in the order of declaration, it also assumes * be fired in the order of declaration, it also assumes
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.33 1998/11/27 19:51:54 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.34 1998/12/14 05:18:39 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -165,7 +165,7 @@ cluster(char *oldrelname, char *oldindexname) ...@@ -165,7 +165,7 @@ cluster(char *oldrelname, char *oldindexname)
/* Create new index over the tuples of the new heap. */ /* Create new index over the tuples of the new heap. */
copy_index(OIDOldIndex, OIDNewHeap); copy_index(OIDOldIndex, OIDNewHeap);
sprintf(NewIndexName, "temp_%x", OIDOldIndex); snprintf(NewIndexName, NAMEDATALEN, "temp_%x", OIDOldIndex);
/* /*
* make this really happen. Flush all the buffers. (Believe me, it is * make this really happen. Flush all the buffers. (Believe me, it is
...@@ -207,7 +207,7 @@ copy_heap(Oid OIDOldHeap) ...@@ -207,7 +207,7 @@ copy_heap(Oid OIDOldHeap)
* Create a new heap relation with a temporary name, which has the * Create a new heap relation with a temporary name, which has the
* same tuple description as the old one. * same tuple description as the old one.
*/ */
sprintf(NewName, "temp_%x", OIDOldHeap); snprintf(NewName, NAMEDATALEN, "temp_%x", OIDOldHeap);
OldHeap = heap_open(OIDOldHeap); OldHeap = heap_open(OIDOldHeap);
OldHeapDesc = RelationGetDescr(OldHeap); OldHeapDesc = RelationGetDescr(OldHeap);
...@@ -273,8 +273,9 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap) ...@@ -273,8 +273,9 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
Old_pg_index_relation_Form = Old_pg_index_relation_Form =
(Form_pg_class) GETSTRUCT(Old_pg_index_relation_Tuple); (Form_pg_class) GETSTRUCT(Old_pg_index_relation_Tuple);
/* Set the name. */
NewIndexName = palloc(NAMEDATALEN); /* XXX */ NewIndexName = palloc(NAMEDATALEN); /* XXX */
sprintf(NewIndexName, "temp_%x", OIDOldIndex); /* Set the name. */ snprintf(NewIndexName, NAMEDATALEN, "temp_%x", OIDOldIndex);
/* /*
* Ugly as it is, the only way I have of working out the number of * Ugly as it is, the only way I have of working out the number of
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.36 1998/11/27 19:51:55 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.37 1998/12/14 05:18:43 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -91,10 +91,10 @@ DefineRelation(CreateStmt *stmt, char relkind) ...@@ -91,10 +91,10 @@ DefineRelation(CreateStmt *stmt, char relkind)
if (constraints != NIL) if (constraints != NIL)
{ {
List *entry; List *entry;
int nconstr = length(constraints); int nconstr = length(constraints),
ncheck = 0,
i;
ConstrCheck *check = (ConstrCheck *) palloc(nconstr * sizeof(ConstrCheck)); ConstrCheck *check = (ConstrCheck *) palloc(nconstr * sizeof(ConstrCheck));
int ncheck = 0;
int i;
foreach(entry, constraints) foreach(entry, constraints)
{ {
...@@ -107,14 +107,16 @@ DefineRelation(CreateStmt *stmt, char relkind) ...@@ -107,14 +107,16 @@ DefineRelation(CreateStmt *stmt, char relkind)
for (i = 0; i < ncheck; i++) for (i = 0; i < ncheck; i++)
{ {
if (strcmp(check[i].ccname, cdef->name) == 0) if (strcmp(check[i].ccname, cdef->name) == 0)
elog(ERROR, "DefineRelation: name (%s) of CHECK constraint duplicated", cdef->name); elog(ERROR,
"DefineRelation: name (%s) of CHECK constraint duplicated",
cdef->name);
} }
check[ncheck].ccname = cdef->name; check[ncheck].ccname = cdef->name;
} }
else else
{ {
check[ncheck].ccname = (char *) palloc(NAMEDATALEN); check[ncheck].ccname = (char *) palloc(NAMEDATALEN);
sprintf(check[ncheck].ccname, "$%d", ncheck + 1); snprintf(check[ncheck].ccname, NAMEDATALEN, "$%d", ncheck + 1);
} }
check[ncheck].ccbin = NULL; check[ncheck].ccbin = NULL;
check[ncheck].ccsrc = (char *) cdef->def; check[ncheck].ccsrc = (char *) cdef->def;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.26 1998/11/27 19:51:56 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.27 1998/12/14 05:18:43 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -64,7 +64,7 @@ createdb(char *dbname, char *dbpath, int encoding) ...@@ -64,7 +64,7 @@ createdb(char *dbname, char *dbpath, int encoding)
{ {
if (*(dbpath + strlen(dbpath) - 1) == SEP_CHAR) if (*(dbpath + strlen(dbpath) - 1) == SEP_CHAR)
*(dbpath + strlen(dbpath) - 1) = '\0'; *(dbpath + strlen(dbpath) - 1) = '\0';
sprintf(loc, "%s%c%s", dbpath, SEP_CHAR, dbname); snprintf(loc, 512, "%s%c%s", dbpath, SEP_CHAR, dbname);
} }
else else
strcpy(loc, dbname); strcpy(loc, dbname);
...@@ -79,20 +79,14 @@ createdb(char *dbname, char *dbpath, int encoding) ...@@ -79,20 +79,14 @@ createdb(char *dbname, char *dbpath, int encoding)
if (mkdir(lp, S_IRWXU) != 0) if (mkdir(lp, S_IRWXU) != 0)
elog(ERROR, "Unable to create database directory '%s'", lp); elog(ERROR, "Unable to create database directory '%s'", lp);
sprintf(buf, "%s %s%cbase%ctemplate1%c* %s", snprintf(buf, 512, "%s %s%cbase%ctemplate1%c* %s",
COPY_CMD, DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR, lp); COPY_CMD, DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR, lp);
system(buf); system(buf);
#if FALSE snprintf(buf, 512,
sprintf(buf, "insert into pg_database (datname, datdba, datpath) \ "insert into pg_database (datname, datdba, encoding, datpath)"
values ('%s'::name, '%d'::oid, '%s'::text);",
dbname, user_id, dbname);
#endif
sprintf(buf, "insert into pg_database (datname, datdba, encoding, datpath)"
" values ('%s', '%d', '%d', '%s');", dbname, user_id, encoding, loc); " values ('%s', '%d', '%d', '%s');", dbname, user_id, encoding, loc);
pg_exec_query(buf); pg_exec_query(buf);
} }
...@@ -101,9 +95,9 @@ destroydb(char *dbname) ...@@ -101,9 +95,9 @@ destroydb(char *dbname)
{ {
int4 user_id; int4 user_id;
Oid db_id; Oid db_id;
char *path; char *path,
char dbpath[MAXPGPATH + 1]; dbpath[MAXPGPATH + 1],
char buf[512]; buf[512];
/* /*
* If this call returns, the database exists and we're allowed to * If this call returns, the database exists and we're allowed to
...@@ -127,8 +121,8 @@ destroydb(char *dbname) ...@@ -127,8 +121,8 @@ destroydb(char *dbname)
* remove the pg_database tuple FIRST, this may fail due to * remove the pg_database tuple FIRST, this may fail due to
* permissions problems * permissions problems
*/ */
sprintf(buf, "delete from pg_database where pg_database.oid = \'%d\'::oid", snprintf(buf, 512,
db_id); "delete from pg_database where pg_database.oid = \'%d\'::oid", db_id);
pg_exec_query(buf); pg_exec_query(buf);
/* /*
...@@ -136,7 +130,7 @@ destroydb(char *dbname) ...@@ -136,7 +130,7 @@ destroydb(char *dbname)
* not be reached * not be reached
*/ */
sprintf(buf, "rm -r %s", path); snprintf(buf, 512, "rm -r %s", path);
system(buf); system(buf);
/* drop pages for this database that are in the shared buffer cache */ /* drop pages for this database that are in the shared buffer cache */
...@@ -305,11 +299,11 @@ stop_vacuum(char *dbpath, char *dbname) ...@@ -305,11 +299,11 @@ stop_vacuum(char *dbpath, char *dbname)
if (strchr(dbpath, SEP_CHAR) != 0) if (strchr(dbpath, SEP_CHAR) != 0)
{ {
sprintf(filename, "%s%cbase%c%s%c%s.vacuum", DataDir, SEP_CHAR, SEP_CHAR, snprintf(filename, 256, "%s%cbase%c%s%c%s.vacuum",
dbname, SEP_CHAR, dbname); DataDir, SEP_CHAR, SEP_CHAR, dbname, SEP_CHAR, dbname);
} }
else else
sprintf(filename, "%s%c%s.vacuum", dbpath, SEP_CHAR, dbname); snprintf(filename, 256, "%s%c%s.vacuum", dbpath, SEP_CHAR, dbname);
if ((fp = AllocateFile(filename, "r")) != NULL) if ((fp = AllocateFile(filename, "r")) != NULL)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.27 1998/11/22 10:48:34 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.28 1998/12/14 05:18:43 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -148,8 +148,8 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) ...@@ -148,8 +148,8 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
{ {
List *l; List *l;
Relation relation; Relation relation;
char *pname; char *pname,
char buf[1000]; buf[1000];
int i; int i;
if (plan == NULL) if (plan == NULL)
...@@ -207,11 +207,6 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) ...@@ -207,11 +207,6 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
break; break;
} }
#if 0
for (i = 0; i < indent; i++)
appendStringInfo(str, " ");
#endif
appendStringInfo(str, pname); appendStringInfo(str, pname);
switch (nodeTag(plan)) switch (nodeTag(plan))
{ {
...@@ -233,7 +228,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) ...@@ -233,7 +228,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
appendStringInfo(str, " on "); appendStringInfo(str, " on ");
if (strcmp(rte->refname, rte->relname) != 0) if (strcmp(rte->refname, rte->relname) != 0)
{ {
sprintf(buf, "%s ", rte->relname); snprintf(buf, 1000, "%s ", rte->relname);
appendStringInfo(str, buf); appendStringInfo(str, buf);
} }
appendStringInfo(str, rte->refname); appendStringInfo(str, rte->refname);
...@@ -244,7 +239,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) ...@@ -244,7 +239,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
} }
if (es->printCost) if (es->printCost)
{ {
sprintf(buf, " (cost=%.2f size=%d width=%d)", snprintf(buf, 1000, " (cost=%.2f size=%d width=%d)",
plan->cost, plan->plan_size, plan->plan_width); plan->cost, plan->plan_size, plan->plan_width);
appendStringInfo(str, buf); appendStringInfo(str, buf);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.25 1998/10/21 16:21:21 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.26 1998/12/14 05:18:44 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -122,7 +122,8 @@ void ...@@ -122,7 +122,8 @@ void
beginRecipe(RecipeStmt *stmt) beginRecipe(RecipeStmt *stmt)
{ {
TgRecipe *r; TgRecipe *r;
int i; int i,
numTees;
QueryTreeList *qList; QueryTreeList *qList;
char portalName[1024]; char portalName[1024];
...@@ -131,7 +132,6 @@ beginRecipe(RecipeStmt *stmt) ...@@ -131,7 +132,6 @@ beginRecipe(RecipeStmt *stmt)
QueryDesc *queryDesc; QueryDesc *queryDesc;
Query *parsetree; Query *parsetree;
int numTees;
TeeInfo *teeInfo; TeeInfo *teeInfo;
/* /*
...@@ -269,7 +269,7 @@ beginRecipe(RecipeStmt *stmt) ...@@ -269,7 +269,7 @@ beginRecipe(RecipeStmt *stmt)
/* define a portal for this viewer input */ /* define a portal for this viewer input */
/* for now, eyes can only have one input */ /* for now, eyes can only have one input */
sprintf(portalName, "%s%d", e->nodeName, 0); snprintf(portalName, 1024, "%s%d", e->nodeName, 0);
queryDesc = CreateQueryDesc(parsetree, queryDesc = CreateQueryDesc(parsetree,
plan, plan,
...@@ -810,15 +810,15 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo) ...@@ -810,15 +810,15 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
{ {
TgElement *elem; TgElement *elem;
char *funcName; char *funcName;
Oid typev[8]; /* eight arguments maximum */ Oid typev[8], /* eight arguments maximum */
int i; relid;
int parameterCount; int i,
parameterCount;
QueryTreeList *qList; /* the parse tree of the nodeElement */ QueryTreeList *qList; /* the parse tree of the nodeElement */
QueryTreeList *inputQlist; /* the list of parse trees for the inputs QueryTreeList *inputQlist; /* the list of parse trees for the inputs
* to this node */ * to this node */
QueryTreeList *q; QueryTreeList *q;
Oid relid;
TgNode *child; TgNode *child;
Relation rel; Relation rel;
unsigned int len; unsigned int len;
...@@ -876,13 +876,13 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo) ...@@ -876,13 +876,13 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
{ {
int i; int i;
sprintf(newquery, "select %s($1", funcName); snprintf(newquery, 1000, "select %s($1", funcName);
for (i = 1; i < parameterCount; i++) for (i = 1; i < parameterCount; i++)
sprintf(newquery, "%s,$%d", newquery, i); snprintf(newquery, 1000, "%s,$%d", newquery, i);
sprintf(newquery, "%s)", newquery); snprintf(newquery, 1000, "%s)", newquery);
} }
else else
sprintf(newquery, "select %s()", funcName); snprintf(newquery, 1000, "select %s()", funcName);
#ifdef DEBUG_RECIPE #ifdef DEBUG_RECIPE
elog(NOTICE, "calling parser with %s", newquery); elog(NOTICE, "calling parser with %s", newquery);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.26 1998/10/21 16:21:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.27 1998/12/14 05:18:44 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -122,7 +122,7 @@ MakeRetrieveViewRuleName(char *viewName) ...@@ -122,7 +122,7 @@ MakeRetrieveViewRuleName(char *viewName)
char *buf; char *buf;
buf = palloc(strlen(viewName) + 5); buf = palloc(strlen(viewName) + 5);
sprintf(buf, "_RET%s", viewName); snprintf(buf, strlen(viewName) + 5, "_RET%s", viewName);
return buf; return buf;
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.25 1998/09/01 04:28:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.26 1998/12/14 05:18:49 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -518,10 +518,6 @@ ExecCreatR(TupleDesc tupType, ...@@ -518,10 +518,6 @@ ExecCreatR(TupleDesc tupType,
* from the range table.. -cim 10/12/89) * from the range table.. -cim 10/12/89)
* ---------------- * ----------------
*/ */
/*
sprintf(tempname, "temp_%d.%d", getpid(), tmpcnt++);
EU1_printf("ExecCreatR: attempting to create %s\n", tempname);
*/
/* /*
* heap_create creates a name if the argument to heap_create is * heap_create creates a name if the argument to heap_create is
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.24 1998/11/27 19:52:02 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/nodeHash.c,v 1.25 1998/12/14 05:18:50 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -341,7 +341,8 @@ ExecHashTableCreate(Hash *node) ...@@ -341,7 +341,8 @@ ExecHashTableCreate(Hash *node)
if (nbatch == 0) if (nbatch == 0)
nbuckets = totalbuckets; nbuckets = totalbuckets;
#ifdef HJDEBUG #ifdef HJDEBUG
printf("nbatch = %d, totalbuckets = %d, nbuckets = %d\n", nbatch, totalbuckets, nbuckets); printf("nbatch = %d, totalbuckets = %d, nbuckets = %d\n",
nbatch, totalbuckets, nbuckets);
#endif #endif
/* ---------------- /* ----------------
...@@ -617,32 +618,14 @@ ExecHashOverflowInsert(HashJoinTable hashtable, ...@@ -617,32 +618,14 @@ ExecHashOverflowInsert(HashJoinTable hashtable,
+ heapTuple->t_len + HEAPTUPLESIZE); + heapTuple->t_len + HEAPTUPLESIZE);
if (newend > hashtable->bottom) if (newend > hashtable->bottom)
{ {
#if 0
elog(DEBUG, "hash table out of memory. expanding.");
/* ------------------
* XXX this is a temporary hack
* eventually, recursive hash partitioning will be
* implemented
* ------------------
*/
hashtable->readbuf = hashtable->bottom = 2 * hashtable->bottom;
hashtable =
(HashJoinTable) repalloc(hashtable, hashtable->bottom + BLCKSZ);
if (hashtable == NULL)
{
perror("repalloc");
elog(ERROR, "can't expand hashtable.");
}
#else
/* ------------------ /* ------------------
* XXX the temporary hack above doesn't work because things * XXX the temporary hack above doesn't work because things
* above us don't know that we've moved the hash table! * above us don't know that we've moved the hash table!
* - Chris Dunlop, <chris@onthe.net.au> * - Chris Dunlop, <chris@onthe.net.au>
* ------------------ * ------------------
*/ */
elog(ERROR, "hash table out of memory. Use -B parameter to increase buffers."); elog(ERROR,
#endif "hash table out of memory. Use -B parameter to increase buffers.");
} }
/* ---------------- /* ----------------
...@@ -897,7 +880,7 @@ static int hjtmpcnt = 0; ...@@ -897,7 +880,7 @@ static int hjtmpcnt = 0;
static void static void
mk_hj_temp(char *tempname) mk_hj_temp(char *tempname)
{ {
sprintf(tempname, "HJ%d.%d", (int) MyProcPid, hjtmpcnt); snprintf(tempname, strlen(tempname), "HJ%d.%d", (int) MyProcPid, hjtmpcnt);
hjtmpcnt = (hjtmpcnt + 1) % 1000; hjtmpcnt = (hjtmpcnt + 1) % 1000;
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* ExecEndTee * ExecEndTee
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.25 1998/11/27 19:52:03 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/Attic/nodeTee.c,v 1.26 1998/12/14 05:18:51 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -144,8 +144,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent) ...@@ -144,8 +144,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
tupType = ExecGetResultType(&(teeState->cstate)); tupType = ExecGetResultType(&(teeState->cstate));
len = ExecTargetListLength(((Plan *) node)->targetlist); len = ExecTargetListLength(((Plan *) node)->targetlist);
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID_); */
/* /*
* create a catalogued relation even though this is a temporary * create a catalogued relation even though this is a temporary
* relation * relation
...@@ -176,7 +174,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent) ...@@ -176,7 +174,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
sprintf(teeState->tee_bufferRelname, sprintf(teeState->tee_bufferRelname,
"ttemp_%d", /* 'ttemp' for 'tee' temporary */ "ttemp_%d", /* 'ttemp' for 'tee' temporary */
newoid()); newoid());
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
bufferRel = heap_open( bufferRel = heap_open(
heap_create_with_catalog(teeState->tee_bufferRelname, heap_create_with_catalog(teeState->tee_bufferRelname,
tupType, RELKIND_RELATION)); tupType, RELKIND_RELATION));
...@@ -429,52 +426,6 @@ ExecTee(Tee *node, Plan *parent) ...@@ -429,52 +426,6 @@ ExecTee(Tee *node, Plan *parent)
return result; return result;
} }
#ifdef NOT_USED
/* ----------------------------------------------------------------
* ExecTeeReScan(node)
*
* Rescans the relation.
* ----------------------------------------------------------------
*/
void
ExecTeeReScan(Tee *node, ExprContext *exprCtxt, Plan *parent)
{
EState *estate;
TeeState *teeState;
ScanDirection dir;
estate = ((Plan *) node)->state;
teeState = node->teestate;
dir = estate->es_direction;
/* XXX doesn't handle backwards direction yet */
if (parent == node->leftParent)
{
if (teeState->tee_leftScanDesc)
{
heap_rescan(teeState->tee_leftScanDesc,
ScanDirectionIsBackward(dir),
NULL);
teeState->tee_leftPlace = 0;
}
}
else
{
if (teeState->tee_rightScanDesc)
{
heap_rescan(teeState->tee_leftScanDesc,
ScanDirectionIsBackward(dir),
NULL);
teeState->tee_rightPlace = 0;
}
}
}
#endif
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
* ExecEndTee * ExecEndTee
* *
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* spi.c-- * spi.c--
* Server Programming Interface * Server Programming Interface
* *
* $Id: spi.c,v 1.29 1998/12/14 05:18:51 scrappy Exp $
*
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#include "executor/spi.h" #include "executor/spi.h"
...@@ -43,10 +45,6 @@ typedef struct ...@@ -43,10 +45,6 @@ typedef struct
static int _SPI_execute(char *src, int tcount, _SPI_plan *plan); static int _SPI_execute(char *src, int tcount, _SPI_plan *plan);
static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount); static int _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount);
#if 0
static void _SPI_fetch(FetchStmt *stmt);
#endif
static int _SPI_execute_plan(_SPI_plan *plan, static int _SPI_execute_plan(_SPI_plan *plan,
Datum *Values, char *Nulls, int tcount); Datum *Values, char *Nulls, int tcount);
...@@ -128,7 +126,7 @@ SPI_connect() ...@@ -128,7 +126,7 @@ SPI_connect()
_SPI_current->tuptable = NULL; _SPI_current->tuptable = NULL;
/* Create Portal for this procedure ... */ /* Create Portal for this procedure ... */
sprintf(pname, "<SPI %d>", _SPI_connected); snprintf(pname, 64, "<SPI %d>", _SPI_connected);
_SPI_current->portal = CreatePortal(pname); _SPI_current->portal = CreatePortal(pname);
if (!PortalIsValid(_SPI_current->portal)) if (!PortalIsValid(_SPI_current->portal))
elog(FATAL, "SPI_connect: initialization failed"); elog(FATAL, "SPI_connect: initialization failed");
...@@ -876,46 +874,6 @@ _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount) ...@@ -876,46 +874,6 @@ _SPI_pquery(QueryDesc *queryDesc, EState *state, int tcount)
} }
#if 0
static void
_SPI_fetch(FetchStmt *stmt)
{
char *name = stmt->portalname;
int feature = (stmt->direction == FORWARD) ? EXEC_FOR : EXEC_BACK;
int count = stmt->howMany;
Portal portal;
QueryDesc *queryDesc;
EState *state;
MemoryContext context;
if (name == NULL)
elog(FATAL, "SPI_fetch from blank portal unsupported");
portal = GetPortalByName(name);
if (!PortalIsValid(portal))
elog(FATAL, "SPI_fetch: portal \"%s\" not found", name);
context = MemoryContextSwitchTo((MemoryContext) PortalGetHeapMemory(portal));
queryDesc = PortalGetQueryDesc(portal);
state = PortalGetState(portal);
ExecutorRun(queryDesc, state, feature, count);
MemoryContextSwitchTo(context); /* switch to the normal Executor
* context */
_SPI_current->processed = state->es_processed;
if (_SPI_checktuples())
elog(FATAL, "SPI_fetch: # of processed tuples check failed");
SPI_processed = _SPI_current->processed;
SPI_tuptable = _SPI_current->tuptable;
}
#endif
static MemoryContext static MemoryContext
_SPI_execmem() _SPI_execmem()
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.31 1998/09/01 04:28:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/auth.c,v 1.32 1998/12/14 05:18:56 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -77,10 +77,10 @@ pg_krb4_recvauth(Port *port) ...@@ -77,10 +77,10 @@ pg_krb4_recvauth(Port *port)
{ {
long krbopts = 0; /* one-way authentication */ long krbopts = 0; /* one-way authentication */
KTEXT_ST clttkt; KTEXT_ST clttkt;
char instance[INST_SZ]; char instance[INST_SZ],
version[KRB_SENDAUTH_VLEN];
AUTH_DAT auth_data; AUTH_DAT auth_data;
Key_schedule key_sched; Key_schedule key_sched;
char version[KRB_SENDAUTH_VLEN];
int status; int status;
strcpy(instance, "*"); /* don't care, but arg gets expanded strcpy(instance, "*"); /* don't care, but arg gets expanded
...@@ -98,28 +98,25 @@ pg_krb4_recvauth(Port *port) ...@@ -98,28 +98,25 @@ pg_krb4_recvauth(Port *port)
version); version);
if (status != KSUCCESS) if (status != KSUCCESS)
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb4_recvauth: kerberos error: %s\n", "pg_krb4_recvauth: kerberos error: %s\n", krb_err_txt[status]);
krb_err_txt[status]);
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
return STATUS_ERROR; return STATUS_ERROR;
} }
if (strncmp(version, PG_KRB4_VERSION, KRB_SENDAUTH_VLEN)) if (strncmp(version, PG_KRB4_VERSION, KRB_SENDAUTH_VLEN))
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb4_recvauth: protocol version != \"%s\"\n", "pg_krb4_recvauth: protocol version != \"%s\"\n", PG_KRB4_VERSION);
PG_KRB4_VERSION);
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
return STATUS_ERROR; return STATUS_ERROR;
} }
if (strncmp(port->user, auth_data.pname, SM_USER)) if (strncmp(port->user, auth_data.pname, SM_USER))
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb4_recvauth: name \"%s\" != \"%s\"\n", "pg_krb4_recvauth: name \"%s\" != \"%s\"\n",
port->user, port->user, auth_data.pname);
auth_data.pname);
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
return STATUS_ERROR; return STATUS_ERROR;
...@@ -131,9 +128,8 @@ pg_krb4_recvauth(Port *port) ...@@ -131,9 +128,8 @@ pg_krb4_recvauth(Port *port)
static int static int
pg_krb4_recvauth(Port *port) pg_krb4_recvauth(Port *port)
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb4_recvauth: Kerberos not implemented on this " "pg_krb4_recvauth: Kerberos not implemented on this server.\n");
"server.\n");
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
...@@ -226,9 +222,8 @@ pg_krb5_recvauth(Port *port) ...@@ -226,9 +222,8 @@ pg_krb5_recvauth(Port *port)
*hostp = '\0'; *hostp = '\0';
if (code = krb5_parse_name(servbuf, &server)) if (code = krb5_parse_name(servbuf, &server))
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb5_recvauth: Kerberos error %d in krb5_parse_name\n", "pg_krb5_recvauth: Kerberos error %d in krb5_parse_name\n", code);
code);
com_err("pg_krb5_recvauth", code, "in krb5_parse_name"); com_err("pg_krb5_recvauth", code, "in krb5_parse_name");
return STATUS_ERROR; return STATUS_ERROR;
} }
...@@ -260,9 +255,8 @@ pg_krb5_recvauth(Port *port) ...@@ -260,9 +255,8 @@ pg_krb5_recvauth(Port *port)
(krb5_ticket **) NULL, (krb5_ticket **) NULL,
(krb5_authenticator **) NULL)) (krb5_authenticator **) NULL))
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb5_recvauth: Kerberos error %d in krb5_recvauth\n", "pg_krb5_recvauth: Kerberos error %d in krb5_recvauth\n", code);
code);
com_err("pg_krb5_recvauth", code, "in krb5_recvauth"); com_err("pg_krb5_recvauth", code, "in krb5_recvauth");
krb5_free_principal(server); krb5_free_principal(server);
return STATUS_ERROR; return STATUS_ERROR;
...@@ -276,9 +270,8 @@ pg_krb5_recvauth(Port *port) ...@@ -276,9 +270,8 @@ pg_krb5_recvauth(Port *port)
*/ */
if ((code = krb5_unparse_name(client, &kusername))) if ((code = krb5_unparse_name(client, &kusername)))
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb5_recvauth: Kerberos error %d in krb5_unparse_name\n", "pg_krb5_recvauth: Kerberos error %d in krb5_unparse_name\n", code);
code);
com_err("pg_krb5_recvauth", code, "in krb5_unparse_name"); com_err("pg_krb5_recvauth", code, "in krb5_unparse_name");
krb5_free_principal(client); krb5_free_principal(client);
return STATUS_ERROR; return STATUS_ERROR;
...@@ -286,7 +279,7 @@ pg_krb5_recvauth(Port *port) ...@@ -286,7 +279,7 @@ pg_krb5_recvauth(Port *port)
krb5_free_principal(client); krb5_free_principal(client);
if (!kusername) if (!kusername)
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb5_recvauth: could not decode username\n"); "pg_krb5_recvauth: could not decode username\n");
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
...@@ -295,9 +288,8 @@ pg_krb5_recvauth(Port *port) ...@@ -295,9 +288,8 @@ pg_krb5_recvauth(Port *port)
kusername = pg_an_to_ln(kusername); kusername = pg_an_to_ln(kusername);
if (strncmp(username, kusername, SM_USER)) if (strncmp(username, kusername, SM_USER))
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb5_recvauth: name \"%s\" != \"%s\"\n", "pg_krb5_recvauth: name \"%s\" != \"%s\"\n", port->user, kusername);
port->user, kusername);
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
pfree(kusername); pfree(kusername);
...@@ -311,9 +303,8 @@ pg_krb5_recvauth(Port *port) ...@@ -311,9 +303,8 @@ pg_krb5_recvauth(Port *port)
static int static int
pg_krb5_recvauth(Port *port) pg_krb5_recvauth(Port *port)
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_krb5_recvauth: Kerberos not implemented on this " "pg_krb5_recvauth: Kerberos not implemented on this server.\n");
"server.\n");
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
...@@ -367,7 +358,7 @@ pg_passwordv0_recvauth(void *arg, PacketLen len, void *pkt) ...@@ -367,7 +358,7 @@ pg_passwordv0_recvauth(void *arg, PacketLen len, void *pkt)
if (user == NULL || password == NULL) if (user == NULL || password == NULL)
{ {
sprintf(PQerrormsg, snprintf(PQerrormsg, ERROR_MSG_LENGTH,
"pg_password_recvauth: badly formed password packet.\n"); "pg_password_recvauth: badly formed password packet.\n");
fputs(PQerrormsg, stderr); fputs(PQerrormsg, stderr);
pqdebug("%s", PQerrormsg); pqdebug("%s", PQerrormsg);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -43,202 +43,208 @@ typedef union ...@@ -43,202 +43,208 @@ typedef union
#define BOTH 269 #define BOTH 269
#define BY 270 #define BY 270
#define CASCADE 271 #define CASCADE 271
#define CAST 272 #define CASE 272
#define CHAR 273 #define CAST 273
#define CHARACTER 274 #define CHAR 274
#define CHECK 275 #define CHARACTER 275
#define CLOSE 276 #define CHECK 276
#define COLLATE 277 #define CLOSE 277
#define COLUMN 278 #define COALESCE 278
#define COMMIT 279 #define COLLATE 279
#define CONSTRAINT 280 #define COLUMN 280
#define CREATE 281 #define COMMIT 281
#define CROSS 282 #define CONSTRAINT 282
#define CURRENT 283 #define CREATE 283
#define CURRENT_DATE 284 #define CROSS 284
#define CURRENT_TIME 285 #define CURRENT 285
#define CURRENT_TIMESTAMP 286 #define CURRENT_DATE 286
#define CURRENT_USER 287 #define CURRENT_TIME 287
#define CURSOR 288 #define CURRENT_TIMESTAMP 288
#define DAY_P 289 #define CURRENT_USER 289
#define DECIMAL 290 #define CURSOR 290
#define DECLARE 291 #define DAY_P 291
#define DEFAULT 292 #define DECIMAL 292
#define DELETE 293 #define DECLARE 293
#define DESC 294 #define DEFAULT 294
#define DISTINCT 295 #define DELETE 295
#define DOUBLE 296 #define DESC 296
#define DROP 297 #define DISTINCT 297
#define END_TRANS 298 #define DOUBLE 298
#define EXECUTE 299 #define DROP 299
#define EXISTS 300 #define ELSE 300
#define EXTRACT 301 #define END_TRANS 301
#define FALSE_P 302 #define EXECUTE 302
#define FETCH 303 #define EXISTS 303
#define FLOAT 304 #define EXTRACT 304
#define FOR 305 #define FALSE_P 305
#define FOREIGN 306 #define FETCH 306
#define FROM 307 #define FLOAT 307
#define FULL 308 #define FOR 308
#define GRANT 309 #define FOREIGN 309
#define GROUP 310 #define FROM 310
#define HAVING 311 #define FULL 311
#define HOUR_P 312 #define GRANT 312
#define IN 313 #define GROUP 313
#define INNER_P 314 #define HAVING 314
#define INSENSITIVE 315 #define HOUR_P 315
#define INSERT 316 #define IN 316
#define INTERVAL 317 #define INNER_P 317
#define INTO 318 #define INSENSITIVE 318
#define IS 319 #define INSERT 319
#define JOIN 320 #define INTERVAL 320
#define KEY 321 #define INTO 321
#define LANGUAGE 322 #define IS 322
#define LEADING 323 #define JOIN 323
#define LEFT 324 #define KEY 324
#define LIKE 325 #define LANGUAGE 325
#define LOCAL 326 #define LEADING 326
#define MATCH 327 #define LEFT 327
#define MINUTE_P 328 #define LIKE 328
#define MONTH_P 329 #define LOCAL 329
#define NAMES 330 #define MATCH 330
#define NATIONAL 331 #define MINUTE_P 331
#define NATURAL 332 #define MONTH_P 332
#define NCHAR 333 #define NAMES 333
#define NEXT 334 #define NATIONAL 334
#define NO 335 #define NATURAL 335
#define NOT 336 #define NCHAR 336
#define NULL_P 337 #define NEXT 337
#define NUMERIC 338 #define NO 338
#define OF 339 #define NOT 339
#define ON 340 #define NULLIF 340
#define ONLY 341 #define NULL_P 341
#define OPTION 342 #define NUMERIC 342
#define OR 343 #define OF 343
#define ORDER 344 #define ON 344
#define OUTER_P 345 #define ONLY 345
#define PARTIAL 346 #define OPTION 346
#define POSITION 347 #define OR 347
#define PRECISION 348 #define ORDER 348
#define PRIMARY 349 #define OUTER_P 349
#define PRIOR 350 #define PARTIAL 350
#define PRIVILEGES 351 #define POSITION 351
#define PROCEDURE 352 #define PRECISION 352
#define PUBLIC 353 #define PRIMARY 353
#define READ 354 #define PRIOR 354
#define REFERENCES 355 #define PRIVILEGES 355
#define RELATIVE 356 #define PROCEDURE 356
#define REVOKE 357 #define PUBLIC 357
#define RIGHT 358 #define READ 358
#define ROLLBACK 359 #define REFERENCES 359
#define SCROLL 360 #define RELATIVE 360
#define SECOND_P 361 #define REVOKE 361
#define SELECT 362 #define RIGHT 362
#define SET 363 #define ROLLBACK 363
#define SUBSTRING 364 #define SCROLL 364
#define TABLE 365 #define SECOND_P 365
#define TIME 366 #define SELECT 366
#define TIMESTAMP 367 #define SET 367
#define TIMEZONE_HOUR 368 #define SUBSTRING 368
#define TIMEZONE_MINUTE 369 #define TABLE 369
#define TO 370 #define THEN 370
#define TRAILING 371 #define TIME 371
#define TRANSACTION 372 #define TIMESTAMP 372
#define TRIM 373 #define TIMEZONE_HOUR 373
#define TRUE_P 374 #define TIMEZONE_MINUTE 374
#define UNION 375 #define TO 375
#define UNIQUE 376 #define TRAILING 376
#define UPDATE 377 #define TRANSACTION 377
#define USER 378 #define TRIM 378
#define USING 379 #define TRUE_P 379
#define VALUES 380 #define UNION 380
#define VARCHAR 381 #define UNIQUE 381
#define VARYING 382 #define UPDATE 382
#define VIEW 383 #define USER 383
#define WHERE 384 #define USING 384
#define WITH 385 #define VALUES 385
#define WORK 386 #define VARCHAR 386
#define YEAR_P 387 #define VARYING 387
#define ZONE 388 #define VIEW 388
#define TRIGGER 389 #define WHEN 389
#define TYPE_P 390 #define WHERE 390
#define ABORT_TRANS 391 #define WITH 391
#define AFTER 392 #define WORK 392
#define AGGREGATE 393 #define YEAR_P 393
#define ANALYZE 394 #define ZONE 394
#define BACKWARD 395 #define TRIGGER 395
#define BEFORE 396 #define TYPE_P 396
#define BINARY 397 #define ABORT_TRANS 397
#define CACHE 398 #define AFTER 398
#define CLUSTER 399 #define AGGREGATE 399
#define COPY 400 #define ANALYZE 400
#define CREATEDB 401 #define BACKWARD 401
#define CREATEUSER 402 #define BEFORE 402
#define CYCLE 403 #define BINARY 403
#define DATABASE 404 #define CACHE 404
#define DELIMITERS 405 #define CLUSTER 405
#define DO 406 #define COPY 406
#define EACH 407 #define CREATEDB 407
#define ENCODING 408 #define CREATEUSER 408
#define EXPLAIN 409 #define CYCLE 409
#define EXTEND 410 #define DATABASE 410
#define FORWARD 411 #define DELIMITERS 411
#define FUNCTION 412 #define DO 412
#define HANDLER 413 #define EACH 413
#define INCREMENT 414 #define ENCODING 414
#define INDEX 415 #define EXPLAIN 415
#define INHERITS 416 #define EXTEND 416
#define INSTEAD 417 #define FORWARD 417
#define ISNULL 418 #define FUNCTION 418
#define LANCOMPILER 419 #define HANDLER 419
#define LISTEN 420 #define INCREMENT 420
#define LOAD 421 #define INDEX 421
#define LOCATION 422 #define INHERITS 422
#define LOCK_P 423 #define INSTEAD 423
#define MAXVALUE 424 #define ISNULL 424
#define MINVALUE 425 #define LANCOMPILER 425
#define MOVE 426 #define LISTEN 426
#define NEW 427 #define LOAD 427
#define NOCREATEDB 428 #define LOCATION 428
#define NOCREATEUSER 429 #define LOCK_P 429
#define NONE 430 #define MAXVALUE 430
#define NOTHING 431 #define MINVALUE 431
#define NOTIFY 432 #define MOVE 432
#define NOTNULL 433 #define NEW 433
#define OIDS 434 #define NOCREATEDB 434
#define OPERATOR 435 #define NOCREATEUSER 435
#define PASSWORD 436 #define NONE 436
#define PROCEDURAL 437 #define NOTHING 437
#define RECIPE 438 #define NOTIFY 438
#define RENAME 439 #define NOTNULL 439
#define RESET 440 #define OIDS 440
#define RETURNS 441 #define OPERATOR 441
#define ROW 442 #define PASSWORD 442
#define RULE 443 #define PROCEDURAL 443
#define SEQUENCE 444 #define RECIPE 444
#define SERIAL 445 #define RENAME 445
#define SETOF 446 #define RESET 446
#define SHOW 447 #define RETURNS 447
#define START 448 #define ROW 448
#define STATEMENT 449 #define RULE 449
#define STDIN 450 #define SEQUENCE 450
#define STDOUT 451 #define SERIAL 451
#define TRUSTED 452 #define SETOF 452
#define UNLISTEN 453 #define SHOW 453
#define UNTIL 454 #define START 454
#define VACUUM 455 #define STATEMENT 455
#define VALID 456 #define STDIN 456
#define VERBOSE 457 #define STDOUT 457
#define VERSION 458 #define TRUSTED 458
#define IDENT 459 #define UNLISTEN 459
#define SCONST 460 #define UNTIL 460
#define Op 461 #define VACUUM 461
#define ICONST 462 #define VALID 462
#define PARAM 463 #define VERBOSE 463
#define FCONST 464 #define VERSION 464
#define OP 465 #define IDENT 465
#define UMINUS 466 #define SCONST 466
#define TYPECAST 467 #define Op 467
#define ICONST 468
#define PARAM 469
#define FCONST 470
#define OP 471
#define UMINUS 472
#define TYPECAST 473
extern YYSTYPE yylval; extern YYSTYPE yylval;
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.43 1998/11/27 19:52:32 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/sort/Attic/psort.c,v 1.44 1998/12/14 05:19:13 scrappy Exp $
* *
* NOTES * NOTES
* Sorts the first relation into the second relation. * Sorts the first relation into the second relation.
...@@ -350,7 +350,9 @@ initialrun(Sort *node) ...@@ -350,7 +350,9 @@ initialrun(Sort *node)
continue; continue;
} }
else else
{
break; break;
}
if ((bool) createrun(node, tp->tp_file) == false) if ((bool) createrun(node, tp->tp_file) == false)
extrapasses = 1 + (PS(node)->Tuples != NULL); extrapasses = 1 + (PS(node)->Tuples != NULL);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: execnodes.h,v 1.19 1998/11/27 19:33:33 vadim Exp $ * $Id: execnodes.h,v 1.20 1998/12/14 05:19:16 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -695,14 +695,14 @@ typedef struct HashState ...@@ -695,14 +695,14 @@ typedef struct HashState
typedef struct TeeState typedef struct TeeState
{ {
CommonState cstate; /* its first field is NodeTag */ CommonState cstate; /* its first field is NodeTag */
int tee_leftPlace; int tee_leftPlace,
int tee_rightPlace; tee_rightPlace,
int tee_lastPlace; tee_lastPlace;
char *tee_bufferRelname; char *tee_bufferRelname;
Relation tee_bufferRel; Relation tee_bufferRel;
MemoryContext tee_mcxt; MemoryContext tee_mcxt;
HeapScanDesc tee_leftScanDesc; HeapScanDesc tee_leftScanDesc,
HeapScanDesc tee_rightScanDesc; tee_rightScanDesc;
} TeeState; } TeeState;
#endif /* EXECNODES_H */ #endif /* EXECNODES_H */
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