I have this annoying habit (among others) of putting

%ud in a printf format strings instead of just %u.

There were three occurances of this in catalog_utils.c,
two in parser.c and one in rewriteSupport.c in the oid
patch that I submitted and was applied.  They won't crash
anything, but the error messages will have a 'd' after the
Oid.  Annoying, but none are db-threatening.

Sorry about that folks...I'll be more careful in the future...

Darren King
This commit is contained in:
Bruce Momjian 1996-12-26 17:47:42 +00:00
parent c5aaba2c34
commit 28a08fd4ac
3 changed files with 33 additions and 33 deletions

View File

@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.4 1996/12/11 03:17:42 bryanh Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.5 1996/12/26 17:46:56 momjian Exp $
* *
* NOTES * NOTES
* Every (plan) node in POSTGRES has an associated "out" routine which * Every (plan) node in POSTGRES has an associated "out" routine which
@ -247,13 +247,13 @@ _outMergeJoin(StringInfo str, MergeJoin *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outNode(str, node->mergeclauses); _outNode(str, node->mergeclauses);
sprintf(buf, " :mergesortop %ud", node->mergesortop); sprintf(buf, " :mergesortop %u", node->mergesortop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :mergerightorder %ud", node->mergerightorder[0]); sprintf(buf, " :mergerightorder %u", node->mergerightorder[0]);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :mergeleftorder %ud", node->mergeleftorder[0]); sprintf(buf, " :mergeleftorder %u", node->mergeleftorder[0]);
appendStringInfo(str, buf); appendStringInfo(str, buf);
} }
@ -273,7 +273,7 @@ _outHashJoin(StringInfo str, HashJoin *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outNode(str, node->hashclauses); _outNode(str, node->hashclauses);
sprintf(buf, " :hashjoinop %ud",node->hashjoinop); sprintf(buf, " :hashjoinop %u",node->hashjoinop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :hashjointable 0x%x", (int) node->hashjointable); sprintf(buf, " :hashjointable 0x%x", (int) node->hashjointable);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -357,7 +357,7 @@ _outTemp(StringInfo str, Temp *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outPlanInfo(str, (Plan*) node); _outPlanInfo(str, (Plan*) node);
sprintf(buf, " :tempid %ud", node->tempid); sprintf(buf, " :tempid %u", node->tempid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :keycount %d", node->keycount); sprintf(buf, " :keycount %d", node->keycount);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -376,7 +376,7 @@ _outSort(StringInfo str, Sort *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outPlanInfo(str, (Plan*) node); _outPlanInfo(str, (Plan*) node);
sprintf(buf, " :tempid %ud", node->tempid); sprintf(buf, " :tempid %u", node->tempid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :keycount %d", node->keycount); sprintf(buf, " :keycount %d", node->keycount);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -425,7 +425,7 @@ _outUnique(StringInfo str, Unique *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outPlanInfo(str, (Plan*) node); _outPlanInfo(str, (Plan*) node);
sprintf(buf, " :tempid %ud", node->tempid); sprintf(buf, " :tempid %u", node->tempid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :keycount %d", node->keycount); sprintf(buf, " :keycount %d", node->keycount);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -497,7 +497,7 @@ _outResdom(StringInfo str, Resdom *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :resno %hd", node->resno); sprintf(buf, " :resno %hd", node->resno);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :restype %ud", node->restype); sprintf(buf, " :restype %u", node->restype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reslen %d", node->reslen); sprintf(buf, " :reslen %d", node->reslen);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -506,7 +506,7 @@ _outResdom(StringInfo str, Resdom *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reskey %d", node->reskey); sprintf(buf, " :reskey %d", node->reskey);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reskeyop %ud", node->reskeyop); sprintf(buf, " :reskeyop %u", node->reskeyop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :resjunk %d", node->resjunk); sprintf(buf, " :resjunk %d", node->resjunk);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -553,7 +553,7 @@ _outExpr(StringInfo str, Expr *node)
sprintf(buf, "EXPR"); sprintf(buf, "EXPR");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :typeOid %d", node->typeOid); sprintf(buf, " :typeOid %u", node->typeOid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
switch(node->opType) { switch(node->opType) {
case OP_EXPR: case OP_EXPR:
@ -596,7 +596,7 @@ _outVar(StringInfo str, Var *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :varattno %hd", node->varattno); sprintf(buf, " :varattno %hd", node->varattno);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :vartype %d", node->vartype); sprintf(buf, " :vartype %u", node->vartype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :varnoold %d", node->varnoold); sprintf(buf, " :varnoold %d", node->varnoold);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -614,7 +614,7 @@ _outConst(StringInfo str, Const *node)
sprintf(buf, "CONST"); sprintf(buf, "CONST");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :consttype %d", node->consttype); sprintf(buf, " :consttype %u", node->consttype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :constlen %hd", node->constlen); sprintf(buf, " :constlen %hd", node->constlen);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -645,9 +645,9 @@ _outAggreg(StringInfo str, Aggreg *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :aggname \"%.*s\"", NAMEDATALEN, (char*)node->aggname); sprintf(buf, " :aggname \"%.*s\"", NAMEDATALEN, (char*)node->aggname);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :basetype %d", node->basetype); sprintf(buf, " :basetype %u", node->basetype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :aggtype %d", node->aggtype); sprintf(buf, " :aggtype %u", node->aggtype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :aggno %d", node->aggno); sprintf(buf, " :aggno %d", node->aggno);
appendStringInfo(str,buf); appendStringInfo(str,buf);
@ -667,7 +667,7 @@ _outArray(StringInfo str, Array *node)
int i; int i;
sprintf(buf, "ARRAY"); sprintf(buf, "ARRAY");
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :arrayelemtype %d", node->arrayelemtype); sprintf(buf, " :arrayelemtype %u", node->arrayelemtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :arrayelemlength %d", node->arrayelemlength); sprintf(buf, " :arrayelemlength %d", node->arrayelemlength);
appendStringInfo(str, buf); appendStringInfo(str, buf);
@ -701,7 +701,7 @@ _outArrayRef(StringInfo str, ArrayRef *node)
sprintf(buf, "ARRAYREF"); sprintf(buf, "ARRAYREF");
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :refelemtype %d", node->refelemtype); sprintf(buf, " :refelemtype %u", node->refelemtype);
appendStringInfo(str, buf); appendStringInfo(str, buf);
sprintf(buf, " :refattrlength %d", node->refattrlength); sprintf(buf, " :refattrlength %d", node->refattrlength);
appendStringInfo(str, buf); appendStringInfo(str, buf);
@ -737,9 +737,9 @@ _outFunc(StringInfo str, Func *node)
sprintf(buf, "FUNC"); sprintf(buf, "FUNC");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :funcid %d", node->funcid); sprintf(buf, " :funcid %u", node->funcid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :functype %d", node->functype); sprintf(buf, " :functype %u", node->functype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :funcisindex %s", sprintf(buf, " :funcisindex %s",
(node->funcisindex ? "true" : "nil")); (node->funcisindex ? "true" : "nil"));
@ -766,11 +766,11 @@ _outOper(StringInfo str, Oper *node)
sprintf(buf, "OPER"); sprintf(buf, "OPER");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :opno %d", node->opno); sprintf(buf, " :opno %u", node->opno);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :opid %d", node->opid); sprintf(buf, " :opid %u", node->opid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :opresulttype %d", node->opresulttype); sprintf(buf, " :opresulttype %u", node->opresulttype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
} }
@ -791,7 +791,7 @@ _outParam(StringInfo str, Param *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :paramname \"%.*s\"", NAMEDATALEN, node->paramname); sprintf(buf, " :paramname \"%.*s\"", NAMEDATALEN, node->paramname);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :paramtype %d", node->paramtype); sprintf(buf, " :paramtype %u", node->paramtype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
appendStringInfo(str, " :param_tlist "); appendStringInfo(str, " :param_tlist ");
@ -943,7 +943,7 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
((node->refname) ? ((char *) node->refname) : "null")); ((node->refname) ? ((char *) node->refname) : "null"));
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :relid %d ", node->relid); sprintf(buf, " :relid %u ", node->relid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
} }
@ -1265,7 +1265,7 @@ _outCInfo(StringInfo str, CInfo *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
_outNode(str, node->mergesortorder); _outNode(str, node->mergesortorder);
sprintf(buf, " :hashjoinoperator %d", node->hashjoinoperator); sprintf(buf, " :hashjoinoperator %u", node->hashjoinoperator);
appendStringInfo(str,buf); appendStringInfo(str,buf);
} }
@ -1305,7 +1305,7 @@ _outHInfo(StringInfo str, HInfo *node)
sprintf(buf, " :hashop "); sprintf(buf, " :hashop ");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, "%d",node->hashop); sprintf(buf, "%u",node->hashop);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :jmkeys "); sprintf(buf, " :jmkeys ");

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.13 1996/12/11 03:17:49 bryanh Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/catalog_utils.c,v 1.14 1996/12/26 17:47:41 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -1397,7 +1397,7 @@ typeid_get_retinfunc(Oid type_id)
0,0,0); 0,0,0);
if ( !HeapTupleIsValid ( typeTuple )) if ( !HeapTupleIsValid ( typeTuple ))
elog(WARN, elog(WARN,
"typeid_get_retinfunc: Invalid type - oid = %ud", "typeid_get_retinfunc: Invalid type - oid = %u",
type_id); type_id);
type = (TypeTupleForm) GETSTRUCT(typeTuple); type = (TypeTupleForm) GETSTRUCT(typeTuple);
@ -1415,7 +1415,7 @@ typeid_get_relid(Oid type_id)
ObjectIdGetDatum(type_id), ObjectIdGetDatum(type_id),
0,0,0); 0,0,0);
if ( !HeapTupleIsValid ( typeTuple )) if ( !HeapTupleIsValid ( typeTuple ))
elog(WARN, "typeid_get_relid: Invalid type - oid = %ud ", type_id); elog(WARN, "typeid_get_relid: Invalid type - oid = %u ", type_id);
type = (TypeTupleForm) GETSTRUCT(typeTuple); type = (TypeTupleForm) GETSTRUCT(typeTuple);
infunc = type->typrelid; infunc = type->typrelid;
@ -1441,7 +1441,7 @@ get_typelem(Oid type_id)
if (!(typeTuple = SearchSysCacheTuple(TYPOID, if (!(typeTuple = SearchSysCacheTuple(TYPOID,
ObjectIdGetDatum(type_id), ObjectIdGetDatum(type_id),
0,0,0))) { 0,0,0))) {
elog (WARN , "type id lookup of %ud failed", type_id); elog (WARN , "type id lookup of %u failed", type_id);
} }
type = (TypeTupleForm) GETSTRUCT(typeTuple); type = (TypeTupleForm) GETSTRUCT(typeTuple);

View File

@ -6,7 +6,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.15 1996/12/07 04:38:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parser.c,v 1.16 1996/12/26 17:47:42 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -357,7 +357,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
const_string = (char *) textout((struct varlena *)const_string); const_string = (char *) textout((struct varlena *)const_string);
break; break;
default: default:
elog(WARN,"unknown type %ud ",exprType); elog(WARN,"unknown type %u ",exprType);
} }
if (!exprType) { if (!exprType) {
@ -405,7 +405,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
0 /*was omitted*/, 0 /*was omitted*/,
0 /* not a set */); 0 /* not a set */);
/* /*
printf("adt %s : %ud %d %d\n",CString(expr),typeid(tp) , printf("adt %s : %u %d %d\n",CString(expr),typeid(tp) ,
len,cp); len,cp);
*/ */
if (string_palloced) pfree(const_string); if (string_palloced) pfree(const_string);