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
This commit is contained in:
parent
f722af618a
commit
7c3b7d2744
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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
|
||||
* some of the executor utility code such as "ExecTypeFromTL" should be
|
||||
|
@ -488,7 +488,8 @@ BuildDescForRelation(List *schema, char *relname)
|
|||
if (arry != NIL)
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -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 *
|
||||
int_range_out(INTRANGE *r)
|
||||
{
|
||||
|
@ -1362,7 +1334,7 @@ int_range_out(INTRANGE *r)
|
|||
if (r == NULL)
|
||||
return NULL;
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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
|
||||
* XXX WARNING
|
||||
|
@ -53,18 +53,6 @@ xidout(TransactionId transactionId)
|
|||
|
||||
}
|
||||
|
||||
#ifdef NOT_USED
|
||||
/* ----------------------------------------------------------------
|
||||
* TransactionIdIsLessThan
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
bool
|
||||
TransactionIdIsLessThan(TransactionId id1, TransactionId id2)
|
||||
{
|
||||
return (bool) (id1 < id2);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------
|
||||
* xideq
|
||||
* ----------------------------------------------------------------
|
||||
|
@ -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
|
||||
* ----------------------------------------------------------------
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -29,40 +29,19 @@
|
|||
char *
|
||||
relpath(char *relname)
|
||||
{
|
||||
char *path;
|
||||
char *path;
|
||||
int bufsize = 0;
|
||||
|
||||
if (IsSharedSystemRelationName(relname))
|
||||
{
|
||||
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2);
|
||||
sprintf(path, "%s/%s", DataDir, relname);
|
||||
bufsize = strlen(DataDir) + sizeof(NameData) + 2;
|
||||
path = (char *) palloc(bufsize);
|
||||
snprintf(path, bufsize, "%s/%s", DataDir, relname);
|
||||
return path;
|
||||
}
|
||||
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 --
|
||||
* True iff name is the name of a system catalog relation.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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
|
||||
* heap_create() - Create an uncataloged heap relation
|
||||
|
@ -244,7 +244,7 @@ heap_create(char *name,
|
|||
|
||||
if (name[0] == '\0')
|
||||
{
|
||||
sprintf(tempname, "temp_%d", relid);
|
||||
snprintf(tempname, NAMEDATALEN, "temp_%d", relid);
|
||||
Assert(strlen(tempname) < NAMEDATALEN);
|
||||
relname = tempname;
|
||||
isTemp = 1;
|
||||
|
@ -1448,8 +1448,9 @@ start:;
|
|||
/* Surround table name with double quotes to allow mixed-case and
|
||||
* whitespaces in names. - BGA 1998-11-14
|
||||
*/
|
||||
sprintf(str, "select %s%s from \"%.*s\"", attrdef->adsrc, cast,
|
||||
NAMEDATALEN, rel->rd_rel->relname.data);
|
||||
snprintf(str, MAX_PARSE_BUFFER,
|
||||
"select %s%s from \"%.*s\"", attrdef->adsrc, cast,
|
||||
NAMEDATALEN, rel->rd_rel->relname.data);
|
||||
setheapoverride(true);
|
||||
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);
|
||||
setheapoverride(false);
|
||||
|
@ -1463,22 +1464,6 @@ start:;
|
|||
expr = te->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 (IS_BINARY_COMPATIBLE(type, atp->atttypid))
|
||||
|
@ -1490,7 +1475,7 @@ start:;
|
|||
if (*cast != 0)
|
||||
elog(ERROR, "DEFAULT clause const type '%s' mismatched with column type '%s'",
|
||||
typeidTypeName(type), typeidTypeName(atp->atttypid));
|
||||
sprintf(cast, ":: %s", typeidTypeName(atp->atttypid));
|
||||
snprintf(cast, 2*NAMEDATALEN, ":: %s", typeidTypeName(atp->atttypid));
|
||||
goto start;
|
||||
}
|
||||
else
|
||||
|
@ -1544,7 +1529,8 @@ StoreRelCheck(Relation rel, ConstrCheck *check)
|
|||
/* Check for table's existance. Surround table name with double-quotes
|
||||
* 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);
|
||||
setheapoverride(true);
|
||||
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*
|
||||
*
|
||||
* 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
|
||||
* At the point the version is defined, 2 physical relations are created
|
||||
|
@ -37,11 +37,6 @@
|
|||
|
||||
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
|
||||
* be fired in the order of declaration, it also assumes
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
*
|
||||
*
|
||||
* 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)
|
|||
|
||||
/* Create new index over the tuples of the new heap. */
|
||||
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
|
||||
|
@ -207,7 +207,7 @@ copy_heap(Oid OIDOldHeap)
|
|||
* Create a new heap relation with a temporary name, which has the
|
||||
* same tuple description as the old one.
|
||||
*/
|
||||
sprintf(NewName, "temp_%x", OIDOldHeap);
|
||||
snprintf(NewName, NAMEDATALEN, "temp_%x", OIDOldHeap);
|
||||
|
||||
OldHeap = heap_open(OIDOldHeap);
|
||||
OldHeapDesc = RelationGetDescr(OldHeap);
|
||||
|
@ -235,17 +235,17 @@ copy_heap(Oid OIDOldHeap)
|
|||
static void
|
||||
copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
|
||||
{
|
||||
Relation OldIndex,
|
||||
NewHeap;
|
||||
HeapTuple Old_pg_index_Tuple,
|
||||
Old_pg_index_relation_Tuple,
|
||||
pg_proc_Tuple;
|
||||
Relation OldIndex,
|
||||
NewHeap;
|
||||
HeapTuple Old_pg_index_Tuple,
|
||||
Old_pg_index_relation_Tuple,
|
||||
pg_proc_Tuple;
|
||||
Form_pg_index Old_pg_index_Form;
|
||||
Form_pg_class Old_pg_index_relation_Form;
|
||||
Form_pg_proc pg_proc_Form;
|
||||
char *NewIndexName;
|
||||
AttrNumber *attnumP;
|
||||
int natts;
|
||||
Form_pg_proc pg_proc_Form;
|
||||
char *NewIndexName;
|
||||
AttrNumber *attnumP;
|
||||
int natts;
|
||||
FuncIndexInfo *finfo;
|
||||
|
||||
NewHeap = heap_open(OIDNewHeap);
|
||||
|
@ -273,8 +273,9 @@ copy_index(Oid OIDOldIndex, Oid OIDNewHeap)
|
|||
Old_pg_index_relation_Form =
|
||||
(Form_pg_class) GETSTRUCT(Old_pg_index_relation_Tuple);
|
||||
|
||||
/* Set the name. */
|
||||
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
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -90,11 +90,11 @@ DefineRelation(CreateStmt *stmt, char relkind)
|
|||
|
||||
if (constraints != NIL)
|
||||
{
|
||||
List *entry;
|
||||
int nconstr = length(constraints);
|
||||
List *entry;
|
||||
int nconstr = length(constraints),
|
||||
ncheck = 0,
|
||||
i;
|
||||
ConstrCheck *check = (ConstrCheck *) palloc(nconstr * sizeof(ConstrCheck));
|
||||
int ncheck = 0;
|
||||
int i;
|
||||
|
||||
foreach(entry, constraints)
|
||||
{
|
||||
|
@ -107,14 +107,16 @@ DefineRelation(CreateStmt *stmt, char relkind)
|
|||
for (i = 0; i < ncheck; i++)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
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].ccsrc = (char *) cdef->def;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -47,8 +47,8 @@ createdb(char *dbname, char *dbpath, int encoding)
|
|||
Oid db_id;
|
||||
int4 user_id;
|
||||
char buf[512];
|
||||
char *lp,
|
||||
loc[512];
|
||||
char *lp,
|
||||
loc[512];
|
||||
|
||||
/*
|
||||
* If this call returns, the database does not exist and we're allowed
|
||||
|
@ -64,7 +64,7 @@ createdb(char *dbname, char *dbpath, int encoding)
|
|||
{
|
||||
if (*(dbpath + strlen(dbpath) - 1) == SEP_CHAR)
|
||||
*(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
|
||||
strcpy(loc, dbname);
|
||||
|
@ -79,20 +79,14 @@ createdb(char *dbname, char *dbpath, int encoding)
|
|||
if (mkdir(lp, S_IRWXU) != 0)
|
||||
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);
|
||||
system(buf);
|
||||
|
||||
#if FALSE
|
||||
sprintf(buf, "insert into pg_database (datname, datdba, datpath) \
|
||||
values ('%s'::name, '%d'::oid, '%s'::text);",
|
||||
dbname, user_id, dbname);
|
||||
#endif
|
||||
|
||||
sprintf(buf, "insert into pg_database (datname, datdba, encoding, datpath)"
|
||||
snprintf(buf, 512,
|
||||
"insert into pg_database (datname, datdba, encoding, datpath)"
|
||||
" values ('%s', '%d', '%d', '%s');", dbname, user_id, encoding, loc);
|
||||
|
||||
|
||||
pg_exec_query(buf);
|
||||
}
|
||||
|
||||
|
@ -101,9 +95,9 @@ destroydb(char *dbname)
|
|||
{
|
||||
int4 user_id;
|
||||
Oid db_id;
|
||||
char *path;
|
||||
char dbpath[MAXPGPATH + 1];
|
||||
char buf[512];
|
||||
char *path,
|
||||
dbpath[MAXPGPATH + 1],
|
||||
buf[512];
|
||||
|
||||
/*
|
||||
* If this call returns, the database exists and we're allowed to
|
||||
|
@ -127,8 +121,8 @@ destroydb(char *dbname)
|
|||
* remove the pg_database tuple FIRST, this may fail due to
|
||||
* permissions problems
|
||||
*/
|
||||
sprintf(buf, "delete from pg_database where pg_database.oid = \'%d\'::oid",
|
||||
db_id);
|
||||
snprintf(buf, 512,
|
||||
"delete from pg_database where pg_database.oid = \'%d\'::oid", db_id);
|
||||
pg_exec_query(buf);
|
||||
|
||||
/*
|
||||
|
@ -136,7 +130,7 @@ destroydb(char *dbname)
|
|||
* not be reached
|
||||
*/
|
||||
|
||||
sprintf(buf, "rm -r %s", path);
|
||||
snprintf(buf, 512, "rm -r %s", path);
|
||||
system(buf);
|
||||
|
||||
/* drop pages for this database that are in the shared buffer cache */
|
||||
|
@ -300,16 +294,16 @@ static void
|
|||
stop_vacuum(char *dbpath, char *dbname)
|
||||
{
|
||||
char filename[256];
|
||||
FILE *fp;
|
||||
FILE *fp;
|
||||
int pid;
|
||||
|
||||
if (strchr(dbpath, SEP_CHAR) != 0)
|
||||
{
|
||||
sprintf(filename, "%s%cbase%c%s%c%s.vacuum", DataDir, SEP_CHAR, SEP_CHAR,
|
||||
dbname, SEP_CHAR, dbname);
|
||||
snprintf(filename, 256, "%s%cbase%c%s%c%s.vacuum",
|
||||
DataDir, SEP_CHAR, SEP_CHAR, dbname, SEP_CHAR, dbname);
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -146,11 +146,11 @@ ExplainOneQuery(Query *query, bool verbose, CommandDest dest)
|
|||
static void
|
||||
explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
|
||||
{
|
||||
List *l;
|
||||
List *l;
|
||||
Relation relation;
|
||||
char *pname;
|
||||
char buf[1000];
|
||||
int i;
|
||||
char *pname,
|
||||
buf[1000];
|
||||
int i;
|
||||
|
||||
if (plan == NULL)
|
||||
{
|
||||
|
@ -207,11 +207,6 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
|
|||
break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
for (i = 0; i < indent; i++)
|
||||
appendStringInfo(str, " ");
|
||||
#endif
|
||||
|
||||
appendStringInfo(str, pname);
|
||||
switch (nodeTag(plan))
|
||||
{
|
||||
|
@ -233,7 +228,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
|
|||
appendStringInfo(str, " on ");
|
||||
if (strcmp(rte->refname, rte->relname) != 0)
|
||||
{
|
||||
sprintf(buf, "%s ", rte->relname);
|
||||
snprintf(buf, 1000, "%s ", rte->relname);
|
||||
appendStringInfo(str, buf);
|
||||
}
|
||||
appendStringInfo(str, rte->refname);
|
||||
|
@ -244,7 +239,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
|
|||
}
|
||||
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);
|
||||
appendStringInfo(str, buf);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -121,18 +121,18 @@ static QueryTreeList *tg_parseTeeNode(TgRecipe * r,
|
|||
void
|
||||
beginRecipe(RecipeStmt *stmt)
|
||||
{
|
||||
TgRecipe *r;
|
||||
int i;
|
||||
TgRecipe *r;
|
||||
int i,
|
||||
numTees;
|
||||
QueryTreeList *qList;
|
||||
char portalName[1024];
|
||||
char portalName[1024];
|
||||
|
||||
Plan *plan;
|
||||
TupleDesc attinfo;
|
||||
QueryDesc *queryDesc;
|
||||
Query *parsetree;
|
||||
Plan *plan;
|
||||
TupleDesc attinfo;
|
||||
QueryDesc *queryDesc;
|
||||
Query *parsetree;
|
||||
|
||||
int numTees;
|
||||
TeeInfo *teeInfo;
|
||||
TeeInfo *teeInfo;
|
||||
|
||||
/*
|
||||
* retrieveRecipe() reads the recipe from the database and returns a
|
||||
|
@ -269,7 +269,7 @@ beginRecipe(RecipeStmt *stmt)
|
|||
|
||||
/* define a portal for this viewer 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,
|
||||
plan,
|
||||
|
@ -808,21 +808,21 @@ tg_parseTeeNode(TgRecipe * r,
|
|||
static QueryTreeList *
|
||||
tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
||||
{
|
||||
TgElement *elem;
|
||||
char *funcName;
|
||||
Oid typev[8]; /* eight arguments maximum */
|
||||
int i;
|
||||
int parameterCount;
|
||||
TgElement *elem;
|
||||
char *funcName;
|
||||
Oid typev[8], /* eight arguments maximum */
|
||||
relid;
|
||||
int i,
|
||||
parameterCount;
|
||||
|
||||
QueryTreeList *qList; /* the parse tree of the nodeElement */
|
||||
QueryTreeList *inputQlist; /* the list of parse trees for the inputs
|
||||
* to this node */
|
||||
QueryTreeList *q;
|
||||
Oid relid;
|
||||
TgNode *child;
|
||||
Relation rel;
|
||||
unsigned int len;
|
||||
TupleDesc tupdesc;
|
||||
TgNode *child;
|
||||
Relation rel;
|
||||
unsigned int len;
|
||||
TupleDesc tupdesc;
|
||||
|
||||
qList = NULL;
|
||||
|
||||
|
@ -876,13 +876,13 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
|||
{
|
||||
int i;
|
||||
|
||||
sprintf(newquery, "select %s($1", funcName);
|
||||
snprintf(newquery, 1000, "select %s($1", funcName);
|
||||
for (i = 1; i < parameterCount; i++)
|
||||
sprintf(newquery, "%s,$%d", newquery, i);
|
||||
sprintf(newquery, "%s)", newquery);
|
||||
snprintf(newquery, 1000, "%s,$%d", newquery, i);
|
||||
snprintf(newquery, 1000, "%s)", newquery);
|
||||
}
|
||||
else
|
||||
sprintf(newquery, "select %s()", funcName);
|
||||
snprintf(newquery, 1000, "select %s()", funcName);
|
||||
|
||||
#ifdef DEBUG_RECIPE
|
||||
elog(NOTICE, "calling parser with %s", newquery);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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)
|
|||
char *buf;
|
||||
|
||||
buf = palloc(strlen(viewName) + 5);
|
||||
sprintf(buf, "_RET%s", viewName);
|
||||
snprintf(buf, strlen(viewName) + 5, "_RET%s", viewName);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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,
|
|||
* 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
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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)
|
|||
if (nbatch == 0)
|
||||
nbuckets = totalbuckets;
|
||||
#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
|
||||
|
||||
/* ----------------
|
||||
|
@ -617,32 +618,14 @@ ExecHashOverflowInsert(HashJoinTable hashtable,
|
|||
+ heapTuple->t_len + HEAPTUPLESIZE);
|
||||
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
|
||||
* above us don't know that we've moved the hash table!
|
||||
* - Chris Dunlop, <chris@onthe.net.au>
|
||||
* ------------------
|
||||
*/
|
||||
elog(ERROR, "hash table out of memory. Use -B parameter to increase buffers.");
|
||||
#endif
|
||||
|
||||
elog(ERROR,
|
||||
"hash table out of memory. Use -B parameter to increase buffers.");
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
|
@ -897,7 +880,7 @@ static int hjtmpcnt = 0;
|
|||
static void
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* ExecEndTee
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -47,12 +47,12 @@
|
|||
bool
|
||||
ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
||||
{
|
||||
TeeState *teeState;
|
||||
Plan *outerPlan;
|
||||
int len;
|
||||
TeeState *teeState;
|
||||
Plan *outerPlan;
|
||||
int len;
|
||||
Relation bufferRel;
|
||||
TupleDesc tupType;
|
||||
EState *estate;
|
||||
EState *estate;
|
||||
|
||||
/*
|
||||
* it is possible that the Tee has already been initialized since it
|
||||
|
@ -144,8 +144,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
|||
tupType = ExecGetResultType(&(teeState->cstate));
|
||||
len = ExecTargetListLength(((Plan *) node)->targetlist);
|
||||
|
||||
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID_); */
|
||||
|
||||
/*
|
||||
* create a catalogued relation even though this is a temporary
|
||||
* relation
|
||||
|
@ -176,7 +174,6 @@ ExecInitTee(Tee *node, EState *currentEstate, Plan *parent)
|
|||
sprintf(teeState->tee_bufferRelname,
|
||||
"ttemp_%d", /* 'ttemp' for 'tee' temporary */
|
||||
newoid());
|
||||
/* bufferRel = ExecCreatR(len, tupType, _TEMP_RELATION_ID); */
|
||||
bufferRel = heap_open(
|
||||
heap_create_with_catalog(teeState->tee_bufferRelname,
|
||||
tupType, RELKIND_RELATION));
|
||||
|
@ -429,52 +426,6 @@ ExecTee(Tee *node, Plan *parent)
|
|||
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
|
||||
*
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* spi.c--
|
||||
* Server Programming Interface
|
||||
*
|
||||
* $Id: spi.c,v 1.29 1998/12/14 05:18:51 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#include "executor/spi.h"
|
||||
|
@ -43,10 +45,6 @@ typedef struct
|
|||
static int _SPI_execute(char *src, int tcount, _SPI_plan *plan);
|
||||
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,
|
||||
Datum *Values, char *Nulls, int tcount);
|
||||
|
||||
|
@ -74,8 +72,8 @@ extern void ShowUsage(void);
|
|||
int
|
||||
SPI_connect()
|
||||
{
|
||||
char pname[64];
|
||||
PortalVariableMemory pvmem;
|
||||
char pname[64];
|
||||
PortalVariableMemory pvmem;
|
||||
|
||||
/*
|
||||
* It's possible on startup and after commit/abort. In future we'll
|
||||
|
@ -128,7 +126,7 @@ SPI_connect()
|
|||
_SPI_current->tuptable = NULL;
|
||||
|
||||
/* Create Portal for this procedure ... */
|
||||
sprintf(pname, "<SPI %d>", _SPI_connected);
|
||||
snprintf(pname, 64, "<SPI %d>", _SPI_connected);
|
||||
_SPI_current->portal = CreatePortal(pname);
|
||||
if (!PortalIsValid(_SPI_current->portal))
|
||||
elog(FATAL, "SPI_connect: initialization failed");
|
||||
|
@ -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
|
||||
_SPI_execmem()
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -75,13 +75,13 @@ static int map_old_to_new(Port *port, UserAuth old, int status);
|
|||
static int
|
||||
pg_krb4_recvauth(Port *port)
|
||||
{
|
||||
long krbopts = 0; /* one-way authentication */
|
||||
KTEXT_ST clttkt;
|
||||
char instance[INST_SZ];
|
||||
AUTH_DAT auth_data;
|
||||
Key_schedule key_sched;
|
||||
char version[KRB_SENDAUTH_VLEN];
|
||||
int status;
|
||||
long krbopts = 0; /* one-way authentication */
|
||||
KTEXT_ST clttkt;
|
||||
char instance[INST_SZ],
|
||||
version[KRB_SENDAUTH_VLEN];
|
||||
AUTH_DAT auth_data;
|
||||
Key_schedule key_sched;
|
||||
int status;
|
||||
|
||||
strcpy(instance, "*"); /* don't care, but arg gets expanded
|
||||
* anyway */
|
||||
|
@ -98,28 +98,25 @@ pg_krb4_recvauth(Port *port)
|
|||
version);
|
||||
if (status != KSUCCESS)
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb4_recvauth: kerberos error: %s\n",
|
||||
krb_err_txt[status]);
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb4_recvauth: kerberos error: %s\n", krb_err_txt[status]);
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
if (strncmp(version, PG_KRB4_VERSION, KRB_SENDAUTH_VLEN))
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb4_recvauth: protocol version != \"%s\"\n",
|
||||
PG_KRB4_VERSION);
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb4_recvauth: protocol version != \"%s\"\n", PG_KRB4_VERSION);
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
if (strncmp(port->user, auth_data.pname, SM_USER))
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb4_recvauth: name \"%s\" != \"%s\"\n",
|
||||
port->user,
|
||||
auth_data.pname);
|
||||
port->user, auth_data.pname);
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
return STATUS_ERROR;
|
||||
|
@ -131,9 +128,8 @@ pg_krb4_recvauth(Port *port)
|
|||
static int
|
||||
pg_krb4_recvauth(Port *port)
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb4_recvauth: Kerberos not implemented on this "
|
||||
"server.\n");
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb4_recvauth: Kerberos not implemented on this server.\n");
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
|
||||
|
@ -226,9 +222,8 @@ pg_krb5_recvauth(Port *port)
|
|||
*hostp = '\0';
|
||||
if (code = krb5_parse_name(servbuf, &server))
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb5_recvauth: Kerberos error %d in krb5_parse_name\n",
|
||||
code);
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb5_recvauth: Kerberos error %d in krb5_parse_name\n", code);
|
||||
com_err("pg_krb5_recvauth", code, "in krb5_parse_name");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
|
@ -260,9 +255,8 @@ pg_krb5_recvauth(Port *port)
|
|||
(krb5_ticket **) NULL,
|
||||
(krb5_authenticator **) NULL))
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb5_recvauth: Kerberos error %d in krb5_recvauth\n",
|
||||
code);
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb5_recvauth: Kerberos error %d in krb5_recvauth\n", code);
|
||||
com_err("pg_krb5_recvauth", code, "in krb5_recvauth");
|
||||
krb5_free_principal(server);
|
||||
return STATUS_ERROR;
|
||||
|
@ -276,9 +270,8 @@ pg_krb5_recvauth(Port *port)
|
|||
*/
|
||||
if ((code = krb5_unparse_name(client, &kusername)))
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb5_recvauth: Kerberos error %d in krb5_unparse_name\n",
|
||||
code);
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb5_recvauth: Kerberos error %d in krb5_unparse_name\n", code);
|
||||
com_err("pg_krb5_recvauth", code, "in krb5_unparse_name");
|
||||
krb5_free_principal(client);
|
||||
return STATUS_ERROR;
|
||||
|
@ -286,7 +279,7 @@ pg_krb5_recvauth(Port *port)
|
|||
krb5_free_principal(client);
|
||||
if (!kusername)
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb5_recvauth: could not decode username\n");
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
|
@ -295,9 +288,8 @@ pg_krb5_recvauth(Port *port)
|
|||
kusername = pg_an_to_ln(kusername);
|
||||
if (strncmp(username, kusername, SM_USER))
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb5_recvauth: name \"%s\" != \"%s\"\n",
|
||||
port->user, kusername);
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb5_recvauth: name \"%s\" != \"%s\"\n", port->user, kusername);
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
pfree(kusername);
|
||||
|
@ -311,9 +303,8 @@ pg_krb5_recvauth(Port *port)
|
|||
static int
|
||||
pg_krb5_recvauth(Port *port)
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
"pg_krb5_recvauth: Kerberos not implemented on this "
|
||||
"server.\n");
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_krb5_recvauth: Kerberos not implemented on this server.\n");
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
|
||||
|
@ -367,7 +358,7 @@ pg_passwordv0_recvauth(void *arg, PacketLen len, void *pkt)
|
|||
|
||||
if (user == NULL || password == NULL)
|
||||
{
|
||||
sprintf(PQerrormsg,
|
||||
snprintf(PQerrormsg, ERROR_MSG_LENGTH,
|
||||
"pg_password_recvauth: badly formed password packet.\n");
|
||||
fputs(PQerrormsg, stderr);
|
||||
pqdebug("%s", PQerrormsg);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -43,202 +43,208 @@ typedef union
|
|||
#define BOTH 269
|
||||
#define BY 270
|
||||
#define CASCADE 271
|
||||
#define CAST 272
|
||||
#define CHAR 273
|
||||
#define CHARACTER 274
|
||||
#define CHECK 275
|
||||
#define CLOSE 276
|
||||
#define COLLATE 277
|
||||
#define COLUMN 278
|
||||
#define COMMIT 279
|
||||
#define CONSTRAINT 280
|
||||
#define CREATE 281
|
||||
#define CROSS 282
|
||||
#define CURRENT 283
|
||||
#define CURRENT_DATE 284
|
||||
#define CURRENT_TIME 285
|
||||
#define CURRENT_TIMESTAMP 286
|
||||
#define CURRENT_USER 287
|
||||
#define CURSOR 288
|
||||
#define DAY_P 289
|
||||
#define DECIMAL 290
|
||||
#define DECLARE 291
|
||||
#define DEFAULT 292
|
||||
#define DELETE 293
|
||||
#define DESC 294
|
||||
#define DISTINCT 295
|
||||
#define DOUBLE 296
|
||||
#define DROP 297
|
||||
#define END_TRANS 298
|
||||
#define EXECUTE 299
|
||||
#define EXISTS 300
|
||||
#define EXTRACT 301
|
||||
#define FALSE_P 302
|
||||
#define FETCH 303
|
||||
#define FLOAT 304
|
||||
#define FOR 305
|
||||
#define FOREIGN 306
|
||||
#define FROM 307
|
||||
#define FULL 308
|
||||
#define GRANT 309
|
||||
#define GROUP 310
|
||||
#define HAVING 311
|
||||
#define HOUR_P 312
|
||||
#define IN 313
|
||||
#define INNER_P 314
|
||||
#define INSENSITIVE 315
|
||||
#define INSERT 316
|
||||
#define INTERVAL 317
|
||||
#define INTO 318
|
||||
#define IS 319
|
||||
#define JOIN 320
|
||||
#define KEY 321
|
||||
#define LANGUAGE 322
|
||||
#define LEADING 323
|
||||
#define LEFT 324
|
||||
#define LIKE 325
|
||||
#define LOCAL 326
|
||||
#define MATCH 327
|
||||
#define MINUTE_P 328
|
||||
#define MONTH_P 329
|
||||
#define NAMES 330
|
||||
#define NATIONAL 331
|
||||
#define NATURAL 332
|
||||
#define NCHAR 333
|
||||
#define NEXT 334
|
||||
#define NO 335
|
||||
#define NOT 336
|
||||
#define NULL_P 337
|
||||
#define NUMERIC 338
|
||||
#define OF 339
|
||||
#define ON 340
|
||||
#define ONLY 341
|
||||
#define OPTION 342
|
||||
#define OR 343
|
||||
#define ORDER 344
|
||||
#define OUTER_P 345
|
||||
#define PARTIAL 346
|
||||
#define POSITION 347
|
||||
#define PRECISION 348
|
||||
#define PRIMARY 349
|
||||
#define PRIOR 350
|
||||
#define PRIVILEGES 351
|
||||
#define PROCEDURE 352
|
||||
#define PUBLIC 353
|
||||
#define READ 354
|
||||
#define REFERENCES 355
|
||||
#define RELATIVE 356
|
||||
#define REVOKE 357
|
||||
#define RIGHT 358
|
||||
#define ROLLBACK 359
|
||||
#define SCROLL 360
|
||||
#define SECOND_P 361
|
||||
#define SELECT 362
|
||||
#define SET 363
|
||||
#define SUBSTRING 364
|
||||
#define TABLE 365
|
||||
#define TIME 366
|
||||
#define TIMESTAMP 367
|
||||
#define TIMEZONE_HOUR 368
|
||||
#define TIMEZONE_MINUTE 369
|
||||
#define TO 370
|
||||
#define TRAILING 371
|
||||
#define TRANSACTION 372
|
||||
#define TRIM 373
|
||||
#define TRUE_P 374
|
||||
#define UNION 375
|
||||
#define UNIQUE 376
|
||||
#define UPDATE 377
|
||||
#define USER 378
|
||||
#define USING 379
|
||||
#define VALUES 380
|
||||
#define VARCHAR 381
|
||||
#define VARYING 382
|
||||
#define VIEW 383
|
||||
#define WHERE 384
|
||||
#define WITH 385
|
||||
#define WORK 386
|
||||
#define YEAR_P 387
|
||||
#define ZONE 388
|
||||
#define TRIGGER 389
|
||||
#define TYPE_P 390
|
||||
#define ABORT_TRANS 391
|
||||
#define AFTER 392
|
||||
#define AGGREGATE 393
|
||||
#define ANALYZE 394
|
||||
#define BACKWARD 395
|
||||
#define BEFORE 396
|
||||
#define BINARY 397
|
||||
#define CACHE 398
|
||||
#define CLUSTER 399
|
||||
#define COPY 400
|
||||
#define CREATEDB 401
|
||||
#define CREATEUSER 402
|
||||
#define CYCLE 403
|
||||
#define DATABASE 404
|
||||
#define DELIMITERS 405
|
||||
#define DO 406
|
||||
#define EACH 407
|
||||
#define ENCODING 408
|
||||
#define EXPLAIN 409
|
||||
#define EXTEND 410
|
||||
#define FORWARD 411
|
||||
#define FUNCTION 412
|
||||
#define HANDLER 413
|
||||
#define INCREMENT 414
|
||||
#define INDEX 415
|
||||
#define INHERITS 416
|
||||
#define INSTEAD 417
|
||||
#define ISNULL 418
|
||||
#define LANCOMPILER 419
|
||||
#define LISTEN 420
|
||||
#define LOAD 421
|
||||
#define LOCATION 422
|
||||
#define LOCK_P 423
|
||||
#define MAXVALUE 424
|
||||
#define MINVALUE 425
|
||||
#define MOVE 426
|
||||
#define NEW 427
|
||||
#define NOCREATEDB 428
|
||||
#define NOCREATEUSER 429
|
||||
#define NONE 430
|
||||
#define NOTHING 431
|
||||
#define NOTIFY 432
|
||||
#define NOTNULL 433
|
||||
#define OIDS 434
|
||||
#define OPERATOR 435
|
||||
#define PASSWORD 436
|
||||
#define PROCEDURAL 437
|
||||
#define RECIPE 438
|
||||
#define RENAME 439
|
||||
#define RESET 440
|
||||
#define RETURNS 441
|
||||
#define ROW 442
|
||||
#define RULE 443
|
||||
#define SEQUENCE 444
|
||||
#define SERIAL 445
|
||||
#define SETOF 446
|
||||
#define SHOW 447
|
||||
#define START 448
|
||||
#define STATEMENT 449
|
||||
#define STDIN 450
|
||||
#define STDOUT 451
|
||||
#define TRUSTED 452
|
||||
#define UNLISTEN 453
|
||||
#define UNTIL 454
|
||||
#define VACUUM 455
|
||||
#define VALID 456
|
||||
#define VERBOSE 457
|
||||
#define VERSION 458
|
||||
#define IDENT 459
|
||||
#define SCONST 460
|
||||
#define Op 461
|
||||
#define ICONST 462
|
||||
#define PARAM 463
|
||||
#define FCONST 464
|
||||
#define OP 465
|
||||
#define UMINUS 466
|
||||
#define TYPECAST 467
|
||||
#define CASE 272
|
||||
#define CAST 273
|
||||
#define CHAR 274
|
||||
#define CHARACTER 275
|
||||
#define CHECK 276
|
||||
#define CLOSE 277
|
||||
#define COALESCE 278
|
||||
#define COLLATE 279
|
||||
#define COLUMN 280
|
||||
#define COMMIT 281
|
||||
#define CONSTRAINT 282
|
||||
#define CREATE 283
|
||||
#define CROSS 284
|
||||
#define CURRENT 285
|
||||
#define CURRENT_DATE 286
|
||||
#define CURRENT_TIME 287
|
||||
#define CURRENT_TIMESTAMP 288
|
||||
#define CURRENT_USER 289
|
||||
#define CURSOR 290
|
||||
#define DAY_P 291
|
||||
#define DECIMAL 292
|
||||
#define DECLARE 293
|
||||
#define DEFAULT 294
|
||||
#define DELETE 295
|
||||
#define DESC 296
|
||||
#define DISTINCT 297
|
||||
#define DOUBLE 298
|
||||
#define DROP 299
|
||||
#define ELSE 300
|
||||
#define END_TRANS 301
|
||||
#define EXECUTE 302
|
||||
#define EXISTS 303
|
||||
#define EXTRACT 304
|
||||
#define FALSE_P 305
|
||||
#define FETCH 306
|
||||
#define FLOAT 307
|
||||
#define FOR 308
|
||||
#define FOREIGN 309
|
||||
#define FROM 310
|
||||
#define FULL 311
|
||||
#define GRANT 312
|
||||
#define GROUP 313
|
||||
#define HAVING 314
|
||||
#define HOUR_P 315
|
||||
#define IN 316
|
||||
#define INNER_P 317
|
||||
#define INSENSITIVE 318
|
||||
#define INSERT 319
|
||||
#define INTERVAL 320
|
||||
#define INTO 321
|
||||
#define IS 322
|
||||
#define JOIN 323
|
||||
#define KEY 324
|
||||
#define LANGUAGE 325
|
||||
#define LEADING 326
|
||||
#define LEFT 327
|
||||
#define LIKE 328
|
||||
#define LOCAL 329
|
||||
#define MATCH 330
|
||||
#define MINUTE_P 331
|
||||
#define MONTH_P 332
|
||||
#define NAMES 333
|
||||
#define NATIONAL 334
|
||||
#define NATURAL 335
|
||||
#define NCHAR 336
|
||||
#define NEXT 337
|
||||
#define NO 338
|
||||
#define NOT 339
|
||||
#define NULLIF 340
|
||||
#define NULL_P 341
|
||||
#define NUMERIC 342
|
||||
#define OF 343
|
||||
#define ON 344
|
||||
#define ONLY 345
|
||||
#define OPTION 346
|
||||
#define OR 347
|
||||
#define ORDER 348
|
||||
#define OUTER_P 349
|
||||
#define PARTIAL 350
|
||||
#define POSITION 351
|
||||
#define PRECISION 352
|
||||
#define PRIMARY 353
|
||||
#define PRIOR 354
|
||||
#define PRIVILEGES 355
|
||||
#define PROCEDURE 356
|
||||
#define PUBLIC 357
|
||||
#define READ 358
|
||||
#define REFERENCES 359
|
||||
#define RELATIVE 360
|
||||
#define REVOKE 361
|
||||
#define RIGHT 362
|
||||
#define ROLLBACK 363
|
||||
#define SCROLL 364
|
||||
#define SECOND_P 365
|
||||
#define SELECT 366
|
||||
#define SET 367
|
||||
#define SUBSTRING 368
|
||||
#define TABLE 369
|
||||
#define THEN 370
|
||||
#define TIME 371
|
||||
#define TIMESTAMP 372
|
||||
#define TIMEZONE_HOUR 373
|
||||
#define TIMEZONE_MINUTE 374
|
||||
#define TO 375
|
||||
#define TRAILING 376
|
||||
#define TRANSACTION 377
|
||||
#define TRIM 378
|
||||
#define TRUE_P 379
|
||||
#define UNION 380
|
||||
#define UNIQUE 381
|
||||
#define UPDATE 382
|
||||
#define USER 383
|
||||
#define USING 384
|
||||
#define VALUES 385
|
||||
#define VARCHAR 386
|
||||
#define VARYING 387
|
||||
#define VIEW 388
|
||||
#define WHEN 389
|
||||
#define WHERE 390
|
||||
#define WITH 391
|
||||
#define WORK 392
|
||||
#define YEAR_P 393
|
||||
#define ZONE 394
|
||||
#define TRIGGER 395
|
||||
#define TYPE_P 396
|
||||
#define ABORT_TRANS 397
|
||||
#define AFTER 398
|
||||
#define AGGREGATE 399
|
||||
#define ANALYZE 400
|
||||
#define BACKWARD 401
|
||||
#define BEFORE 402
|
||||
#define BINARY 403
|
||||
#define CACHE 404
|
||||
#define CLUSTER 405
|
||||
#define COPY 406
|
||||
#define CREATEDB 407
|
||||
#define CREATEUSER 408
|
||||
#define CYCLE 409
|
||||
#define DATABASE 410
|
||||
#define DELIMITERS 411
|
||||
#define DO 412
|
||||
#define EACH 413
|
||||
#define ENCODING 414
|
||||
#define EXPLAIN 415
|
||||
#define EXTEND 416
|
||||
#define FORWARD 417
|
||||
#define FUNCTION 418
|
||||
#define HANDLER 419
|
||||
#define INCREMENT 420
|
||||
#define INDEX 421
|
||||
#define INHERITS 422
|
||||
#define INSTEAD 423
|
||||
#define ISNULL 424
|
||||
#define LANCOMPILER 425
|
||||
#define LISTEN 426
|
||||
#define LOAD 427
|
||||
#define LOCATION 428
|
||||
#define LOCK_P 429
|
||||
#define MAXVALUE 430
|
||||
#define MINVALUE 431
|
||||
#define MOVE 432
|
||||
#define NEW 433
|
||||
#define NOCREATEDB 434
|
||||
#define NOCREATEUSER 435
|
||||
#define NONE 436
|
||||
#define NOTHING 437
|
||||
#define NOTIFY 438
|
||||
#define NOTNULL 439
|
||||
#define OIDS 440
|
||||
#define OPERATOR 441
|
||||
#define PASSWORD 442
|
||||
#define PROCEDURAL 443
|
||||
#define RECIPE 444
|
||||
#define RENAME 445
|
||||
#define RESET 446
|
||||
#define RETURNS 447
|
||||
#define ROW 448
|
||||
#define RULE 449
|
||||
#define SEQUENCE 450
|
||||
#define SERIAL 451
|
||||
#define SETOF 452
|
||||
#define SHOW 453
|
||||
#define START 454
|
||||
#define STATEMENT 455
|
||||
#define STDIN 456
|
||||
#define STDOUT 457
|
||||
#define TRUSTED 458
|
||||
#define UNLISTEN 459
|
||||
#define UNTIL 460
|
||||
#define VACUUM 461
|
||||
#define VALID 462
|
||||
#define VERBOSE 463
|
||||
#define VERSION 464
|
||||
#define IDENT 465
|
||||
#define SCONST 466
|
||||
#define Op 467
|
||||
#define ICONST 468
|
||||
#define PARAM 469
|
||||
#define FCONST 470
|
||||
#define OP 471
|
||||
#define UMINUS 472
|
||||
#define TYPECAST 473
|
||||
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*
|
||||
* 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
|
||||
* Sorts the first relation into the second relation.
|
||||
|
@ -350,7 +350,9 @@ initialrun(Sort *node)
|
|||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if ((bool) createrun(node, tp->tp_file) == false)
|
||||
extrapasses = 1 + (PS(node)->Tuples != NULL);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*
|
||||
* 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 $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
@ -694,15 +694,15 @@ typedef struct HashState
|
|||
*/
|
||||
typedef struct TeeState
|
||||
{
|
||||
CommonState cstate; /* its first field is NodeTag */
|
||||
int tee_leftPlace;
|
||||
int tee_rightPlace;
|
||||
int tee_lastPlace;
|
||||
char *tee_bufferRelname;
|
||||
Relation tee_bufferRel;
|
||||
CommonState cstate; /* its first field is NodeTag */
|
||||
int tee_leftPlace,
|
||||
tee_rightPlace,
|
||||
tee_lastPlace;
|
||||
char *tee_bufferRelname;
|
||||
Relation tee_bufferRel;
|
||||
MemoryContext tee_mcxt;
|
||||
HeapScanDesc tee_leftScanDesc;
|
||||
HeapScanDesc tee_rightScanDesc;
|
||||
HeapScanDesc tee_leftScanDesc,
|
||||
tee_rightScanDesc;
|
||||
} TeeState;
|
||||
|
||||
#endif /* EXECNODES_H */
|
||||
|
|
Loading…
Reference in New Issue