Commit b99c63cf authored by Bruce Momjian's avatar Bruce Momjian

Now that names are null terminated, no need to do all that NAMEDATALEN stuff.

parent 022903f2
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.13 1997/01/10 20:16:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.14 1997/08/18 20:51:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -131,9 +131,8 @@ printatt(unsigned attributeId, ...@@ -131,9 +131,8 @@ printatt(unsigned attributeId,
AttributeTupleForm attributeP, AttributeTupleForm attributeP,
char *value) char *value)
{ {
printf("\t%2d: %.*s%s%s%s\t(typeid = %u, len = %d, byval = %c)\n", printf("\t%2d: %s%s%s%s\t(typeid = %u, len = %d, byval = %c)\n",
attributeId, attributeId,
NAMEDATALEN, /* attname is a char16 */
attributeP->attname.data, attributeP->attname.data,
value != NULL ? " = \"" : "", value != NULL ? " = \"" : "",
value != NULL ? value : "", value != NULL ? value : "",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.12 1997/08/03 02:34:19 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.13 1997/08/18 20:51:31 momjian 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
...@@ -347,18 +347,11 @@ BuildDescForRelation(List *schema, char *relname) ...@@ -347,18 +347,11 @@ BuildDescForRelation(List *schema, char *relname)
arry = entry->typename->arrayBounds; arry = entry->typename->arrayBounds;
attisset = entry->typename->setof; attisset = entry->typename->setof;
if (arry != NIL) { strNcpy(typename, entry->typename->name,NAMEDATALEN-1);
char buf[20]; if (arry != NIL)
attdim = length(arry); attdim = length(arry);
else
/* array of XXX is _XXX (inherited from release 3) */
sprintf(buf, "_%.*s", NAMEDATALEN, entry->typename->name);
strcpy(typename, buf);
} else {
strcpy(typename, entry->typename->name);
attdim = 0; attdim = 0;
}
if (! TupleDescInitEntry(desc, attnum, attname, if (! TupleDescInitEntry(desc, attnum, attname,
typename, attdim, attisset)) { typename, attdim, attisset)) {
...@@ -372,8 +365,8 @@ BuildDescForRelation(List *schema, char *relname) ...@@ -372,8 +365,8 @@ BuildDescForRelation(List *schema, char *relname)
if (!strcmp(typename, relname)) { if (!strcmp(typename, relname)) {
TupleDescMakeSelfReference(desc, attnum, relname); TupleDescMakeSelfReference(desc, attnum, relname);
} else } else
elog(WARN, "DefineRelation: no such type %.*s", elog(WARN, "DefineRelation: no such type %s",
NAMEDATALEN, typename); typename);
} }
/* /*
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.8 1997/08/12 22:51:37 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/access/hash/hashpage.c,v 1.9 1997/08/18 20:51:34 momjian Exp $
* *
* NOTES * NOTES
* Postgres hash pages look like ordinary relation pages. The opaque * Postgres hash pages look like ordinary relation pages. The opaque
...@@ -195,8 +195,8 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access) ...@@ -195,8 +195,8 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
_hash_setpagelock(rel, blkno, access); _hash_setpagelock(rel, blkno, access);
break; break;
default: default:
elog(WARN, "_hash_getbuf: invalid access (%d) on new blk: %.*s", elog(WARN, "_hash_getbuf: invalid access (%d) on new blk: %s",
access, NAMEDATALEN, RelationGetRelationName(rel)); access, RelationGetRelationName(rel));
break; break;
} }
buf = ReadBuffer(rel, blkno); buf = ReadBuffer(rel, blkno);
...@@ -221,8 +221,8 @@ _hash_relbuf(Relation rel, Buffer buf, int access) ...@@ -221,8 +221,8 @@ _hash_relbuf(Relation rel, Buffer buf, int access)
_hash_unsetpagelock(rel, blkno, access); _hash_unsetpagelock(rel, blkno, access);
break; break;
default: default:
elog(WARN, "_hash_relbuf: invalid access (%d) on blk %x: %.*s", elog(WARN, "_hash_relbuf: invalid access (%d) on blk %x: %s",
access, blkno, NAMEDATALEN, RelationGetRelationName(rel)); access, blkno, RelationGetRelationName(rel));
} }
ReleaseBuffer(buf); ReleaseBuffer(buf);
...@@ -279,8 +279,8 @@ _hash_chgbufaccess(Relation rel, ...@@ -279,8 +279,8 @@ _hash_chgbufaccess(Relation rel,
_hash_relbuf(rel, *bufp, from_access); _hash_relbuf(rel, *bufp, from_access);
break; break;
default: default:
elog(WARN, "_hash_chgbufaccess: invalid access (%d) on blk %x: %.*s", elog(WARN, "_hash_chgbufaccess: invalid access (%d) on blk %x: %s",
from_access, blkno, NAMEDATALEN, RelationGetRelationName(rel)); from_access, blkno, RelationGetRelationName(rel));
break; break;
} }
*bufp = _hash_getbuf(rel, blkno, to_access); *bufp = _hash_getbuf(rel, blkno, to_access);
...@@ -325,8 +325,8 @@ _hash_setpagelock(Relation rel, ...@@ -325,8 +325,8 @@ _hash_setpagelock(Relation rel,
RelationSetSingleRLockPage(rel, &iptr); RelationSetSingleRLockPage(rel, &iptr);
break; break;
default: default:
elog(WARN, "_hash_setpagelock: invalid access (%d) on blk %x: %.*s", elog(WARN, "_hash_setpagelock: invalid access (%d) on blk %x: %s",
access, blkno, NAMEDATALEN, RelationGetRelationName(rel)); access, blkno, RelationGetRelationName(rel));
break; break;
} }
} }
...@@ -350,8 +350,8 @@ _hash_unsetpagelock(Relation rel, ...@@ -350,8 +350,8 @@ _hash_unsetpagelock(Relation rel,
RelationUnsetSingleRLockPage(rel, &iptr); RelationUnsetSingleRLockPage(rel, &iptr);
break; break;
default: default:
elog(WARN, "_hash_unsetpagelock: invalid access (%d) on blk %x: %.*s", elog(WARN, "_hash_unsetpagelock: invalid access (%d) on blk %x: %s",
access, blkno, NAMEDATALEN, RelationGetRelationName(rel)); access, blkno, RelationGetRelationName(rel));
break; break;
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.19 1997/08/12 22:52:04 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.20 1997/08/18 20:51:44 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -510,8 +510,8 @@ boot_openrel(char *relname) ...@@ -510,8 +510,8 @@ boot_openrel(char *relname)
if (DebugMode) { if (DebugMode) {
AttributeTupleForm at = attrtypes[i]; AttributeTupleForm at = attrtypes[i];
printf("create attribute %d name %.*s len %d num %d type %d\n", printf("create attribute %d name %s len %d num %d type %d\n",
i, NAMEDATALEN, at->attname.data, at->attlen, at->attnum, i, at->attname.data, at->attlen, at->attnum,
at->atttypid at->atttypid
); );
fflush(stdout); fflush(stdout);
...@@ -572,16 +572,14 @@ DefineAttr(char *name, char *type, int attnum) ...@@ -572,16 +572,14 @@ DefineAttr(char *name, char *type, int attnum)
if (Typ != (struct typmap **)NULL) { if (Typ != (struct typmap **)NULL) {
attrtypes[attnum]->atttypid = Ap->am_oid; attrtypes[attnum]->atttypid = Ap->am_oid;
namestrcpy(&attrtypes[attnum]->attname, name); namestrcpy(&attrtypes[attnum]->attname, name);
if (!Quiet) printf("<%.*s %s> ", NAMEDATALEN, if (!Quiet) printf("<%s %s> ", attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */ attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen; attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
attrtypes[attnum]->attbyval = Ap->am_typ.typbyval; attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
} else { } else {
attrtypes[attnum]->atttypid = Procid[t].oid; attrtypes[attnum]->atttypid = Procid[t].oid;
namestrcpy(&attrtypes[attnum]->attname,name); namestrcpy(&attrtypes[attnum]->attname,name);
if (!Quiet) printf("<%.*s %s> ", NAMEDATALEN, if (!Quiet) printf("<%s %s> ", attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */ attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Procid[t].len; attlen = attrtypes[attnum]->attlen = Procid[t].len;
attrtypes[attnum]->attbyval = (attlen==1) || (attlen==2)||(attlen==4); attrtypes[attnum]->attbyval = (attlen==1) || (attlen==2)||(attlen==4);
...@@ -775,7 +773,7 @@ gettype(char *type) ...@@ -775,7 +773,7 @@ gettype(char *type)
} }
} }
if (DebugMode) if (DebugMode)
printf("bootstrap.c: External Type: %.*s\n", NAMEDATALEN, type); printf("bootstrap.c: External Type: %s\n", type);
rdesc = heap_openr(TypeRelationName); rdesc = heap_openr(TypeRelationName);
sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey)NULL); sdesc = heap_beginscan(rdesc, 0, NowTimeQual, 0, (ScanKey)NULL);
i = 0; i = 0;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.6 1997/01/10 20:16:34 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.7 1997/08/18 20:51:59 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -33,7 +33,7 @@ relpath(char relname[]) ...@@ -33,7 +33,7 @@ relpath(char relname[])
if (IsSharedSystemRelationName(relname)) { if (IsSharedSystemRelationName(relname)) {
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2); path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2);
sprintf(path, "%s/%.*s", DataDir, NAMEDATALEN, relname); sprintf(path, "%s/%s", DataDir, relname);
return (path); return (path);
} }
return(relname); return(relname);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.10 1997/08/12 22:52:11 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.11 1997/08/18 20:52:04 momjian Exp $
* *
* NOTES * NOTES
* these routines moved here from commands/define.c and somewhat cleaned up. * these routines moved here from commands/define.c and somewhat cleaned up.
...@@ -483,8 +483,8 @@ OperatorDef(char *operatorName, ...@@ -483,8 +483,8 @@ OperatorDef(char *operatorName,
rightTypeName); rightTypeName);
if (OidIsValid(operatorObjectId) && !definedOK) if (OidIsValid(operatorObjectId) && !definedOK)
elog(WARN, "OperatorDef: operator \"%-.*s\" already defined", elog(WARN, "OperatorDef: operator \"%s\" already defined",
NAMEDATALEN, operatorName); operatorName);
if (leftTypeName) if (leftTypeName)
leftTypeId = TypeGet(leftTypeName, &leftDefined); leftTypeId = TypeGet(leftTypeName, &leftDefined);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.11 1997/08/03 02:34:45 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.12 1997/08/18 20:52:07 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -116,15 +116,15 @@ cluster(char oldrelname[], char oldindexname[]) ...@@ -116,15 +116,15 @@ cluster(char oldrelname[], char oldindexname[])
OldHeap = heap_openr(oldrelname); OldHeap = heap_openr(oldrelname);
if (!RelationIsValid(OldHeap)) { if (!RelationIsValid(OldHeap)) {
elog(WARN, "cluster: unknown relation: \"%-.*s\"", elog(WARN, "cluster: unknown relation: \"%s\"",
NAMEDATALEN, oldrelname); oldrelname);
} }
OIDOldHeap = OldHeap->rd_id; /* Get OID for the index scan */ OIDOldHeap = OldHeap->rd_id; /* Get OID for the index scan */
OldIndex=index_openr(oldindexname);/* Open old index relation */ OldIndex=index_openr(oldindexname);/* Open old index relation */
if (!RelationIsValid(OldIndex)) { if (!RelationIsValid(OldIndex)) {
elog(WARN, "cluster: unknown index: \"%-.*s\"", elog(WARN, "cluster: unknown index: \"%s\"",
NAMEDATALEN, oldindexname); oldindexname);
} }
OIDOldIndex = OldIndex->rd_id; /* OID for the index scan */ OIDOldIndex = OldIndex->rd_id; /* OID for the index scan */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.8 1997/08/12 22:52:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.9 1997/08/18 20:52:11 momjian Exp $
* *
* NOTES * NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated * The PortalExecutorHeapMemory crap needs to be eliminated
...@@ -117,8 +117,8 @@ PerformPortalFetch(char *name, ...@@ -117,8 +117,8 @@ PerformPortalFetch(char *name,
*/ */
portal = GetPortalByName(name); portal = GetPortalByName(name);
if (! PortalIsValid(portal)) { if (! PortalIsValid(portal)) {
elog(NOTICE, "PerformPortalFetch: portal \"%-.*s\" not found", elog(NOTICE, "PerformPortalFetch: portal \"%s\" not found",
NAMEDATALEN, name); name);
return; return;
} }
...@@ -202,8 +202,8 @@ PerformPortalClose(char *name, CommandDest dest) ...@@ -202,8 +202,8 @@ PerformPortalClose(char *name, CommandDest dest)
*/ */
portal = GetPortalByName(name); portal = GetPortalByName(name);
if (! PortalIsValid(portal)) { if (! PortalIsValid(portal)) {
elog(NOTICE, "PerformPortalClose: portal \"%-.*s\" not found", elog(NOTICE, "PerformPortalClose: portal \"%s\" not found",
NAMEDATALEN, name); name);
return; return;
} }
...@@ -272,8 +272,8 @@ PerformAddAttribute(char *relationName, ...@@ -272,8 +272,8 @@ PerformAddAttribute(char *relationName,
* normally, only the owner of a class can change its schema. * normally, only the owner of a class can change its schema.
*/ */
if (IsSystemRelationName(relationName)) if (IsSystemRelationName(relationName))
elog(WARN, "PerformAddAttribute: class \"%-.*s\" is a system catalog", elog(WARN, "PerformAddAttribute: class \"%s\" is a system catalog",
NAMEDATALEN, relationName); relationName);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(userName, relationName, RELNAME)) if (!pg_ownercheck(userName, relationName, RELNAME))
elog(WARN, "PerformAddAttribute: you do not own class \"%s\"", elog(WARN, "PerformAddAttribute: you do not own class \"%s\"",
...@@ -296,8 +296,8 @@ PerformAddAttribute(char *relationName, ...@@ -296,8 +296,8 @@ PerformAddAttribute(char *relationName,
relrdesc = heap_openr(relationName); relrdesc = heap_openr(relationName);
if (!RelationIsValid(relrdesc)) { if (!RelationIsValid(relrdesc)) {
elog(WARN, "PerformAddAttribute: unknown relation: \"%-.*s\"", elog(WARN, "PerformAddAttribute: unknown relation: \"%s\"",
NAMEDATALEN, relationName); relationName);
} }
myrelid = relrdesc->rd_id; myrelid = relrdesc->rd_id;
heap_close(relrdesc); heap_close(relrdesc);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.10 1997/08/12 22:52:20 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.11 1997/08/18 20:52:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.9 1997/04/05 06:42:32 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/explain.c,v 1.10 1997/08/18 20:52:17 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -177,7 +177,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es) ...@@ -177,7 +177,7 @@ explain_outNode(StringInfo str, Plan *plan, int indent, ExplainState *es)
case T_IndexScan: case T_IndexScan:
if (((Scan*)plan)->scanrelid > 0) { if (((Scan*)plan)->scanrelid > 0) {
RangeTblEntry *rte = nth(((Scan*)plan)->scanrelid-1, es->rtable); RangeTblEntry *rte = nth(((Scan*)plan)->scanrelid-1, es->rtable);
sprintf(buf, " on %.*s", NAMEDATALEN, rte->refname); sprintf(buf, " on %s", rte->refname);
appendStringInfo(str, buf); appendStringInfo(str, buf);
} }
break; break;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.9 1997/06/03 06:23:24 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.10 1997/08/18 20:52:17 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -393,8 +393,8 @@ RemoveFunction(char *functionName, /* function name to be removed */ ...@@ -393,8 +393,8 @@ RemoveFunction(char *functionName, /* function name to be removed */
/* ok, function has been found */ /* ok, function has been found */
if (the_proc->prolang == INTERNALlanguageId) if (the_proc->prolang == INTERNALlanguageId)
elog(WARN, "RemoveFunction: function \"%-.*s\" is built-in", elog(WARN, "RemoveFunction: function \"%s\" is built-in",
NAMEDATALEN, functionName); functionName);
ItemPointerCopy(&tup->t_ctid, &itemPointerData); ItemPointerCopy(&tup->t_ctid, &itemPointerData);
heap_delete(relation, &itemPointerData); heap_delete(relation, &itemPointerData);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.6 1997/08/12 22:52:27 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.7 1997/08/18 20:52:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -78,13 +78,13 @@ renameatt(char *relname, ...@@ -78,13 +78,13 @@ renameatt(char *relname,
* normally, only the owner of a class can change its schema. * normally, only the owner of a class can change its schema.
*/ */
if (IsSystemRelationName(relname)) if (IsSystemRelationName(relname))
elog(WARN, "renameatt: class \"%-.*s\" is a system catalog", elog(WARN, "renameatt: class \"%s\" is a system catalog",
NAMEDATALEN, relname); relname);
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!IsBootstrapProcessingMode() && if (!IsBootstrapProcessingMode() &&
!pg_ownercheck(userName, relname, RELNAME)) !pg_ownercheck(userName, relname, RELNAME))
elog(WARN, "renameatt: you do not own class \"%-.*s\"", elog(WARN, "renameatt: you do not own class \"%s\"",
NAMEDATALEN, relname); relname);
#endif #endif
/* /*
...@@ -102,8 +102,8 @@ renameatt(char *relname, ...@@ -102,8 +102,8 @@ renameatt(char *relname,
relrdesc = heap_openr(relname); relrdesc = heap_openr(relname);
if (!RelationIsValid(relrdesc)) { if (!RelationIsValid(relrdesc)) {
elog(WARN, "renameatt: unknown relation: \"%-.*s\"", elog(WARN, "renameatt: unknown relation: \"%s\"",
NAMEDATALEN, relname); relname);
} }
myrelid = relrdesc->rd_id; myrelid = relrdesc->rd_id;
heap_close(relrdesc); heap_close(relrdesc);
...@@ -139,8 +139,8 @@ renameatt(char *relname, ...@@ -139,8 +139,8 @@ renameatt(char *relname,
reltup = ClassNameIndexScan(relrdesc, relname); reltup = ClassNameIndexScan(relrdesc, relname);
if (!PointerIsValid(reltup)) { if (!PointerIsValid(reltup)) {
heap_close(relrdesc); heap_close(relrdesc);
elog(WARN, "renameatt: relation \"%-.*s\" nonexistent", elog(WARN, "renameatt: relation \"%s\" nonexistent",
NAMEDATALEN, relname); relname);
return; return;
} }
heap_close(relrdesc); heap_close(relrdesc);
...@@ -149,20 +149,20 @@ renameatt(char *relname, ...@@ -149,20 +149,20 @@ renameatt(char *relname,
oldatttup = AttributeNameIndexScan(attrdesc, reltup->t_oid, oldattname); oldatttup = AttributeNameIndexScan(attrdesc, reltup->t_oid, oldattname);
if (!PointerIsValid(oldatttup)) { if (!PointerIsValid(oldatttup)) {
heap_close(attrdesc); heap_close(attrdesc);
elog(WARN, "renameatt: attribute \"%-.*s\" nonexistent", elog(WARN, "renameatt: attribute \"%s\" nonexistent",
NAMEDATALEN, oldattname); oldattname);
} }
if (((AttributeTupleForm ) GETSTRUCT(oldatttup))->attnum < 0) { if (((AttributeTupleForm ) GETSTRUCT(oldatttup))->attnum < 0) {
elog(WARN, "renameatt: system attribute \"%-.*s\" not renamed", elog(WARN, "renameatt: system attribute \"%s\" not renamed",
NAMEDATALEN, oldattname); oldattname);
} }
newatttup = AttributeNameIndexScan(attrdesc, reltup->t_oid, newattname); newatttup = AttributeNameIndexScan(attrdesc, reltup->t_oid, newattname);
if (PointerIsValid(newatttup)) { if (PointerIsValid(newatttup)) {
pfree(oldatttup); pfree(oldatttup);
heap_close(attrdesc); heap_close(attrdesc);
elog(WARN, "renameatt: attribute \"%-.*s\" exists", elog(WARN, "renameatt: attribute \"%s\" exists",
NAMEDATALEN, newattname); newattname);
} }
namestrcpy(&(((AttributeTupleForm)(GETSTRUCT(oldatttup)))->attname), namestrcpy(&(((AttributeTupleForm)(GETSTRUCT(oldatttup)))->attname),
...@@ -207,13 +207,13 @@ renamerel(char oldrelname[], char newrelname[]) ...@@ -207,13 +207,13 @@ renamerel(char oldrelname[], char newrelname[])
Relation idescs[Num_pg_class_indices]; Relation idescs[Num_pg_class_indices];
if (IsSystemRelationName(oldrelname)) { if (IsSystemRelationName(oldrelname)) {
elog(WARN, "renamerel: system relation \"%-.*s\" not renamed", elog(WARN, "renamerel: system relation \"%s\" not renamed",
NAMEDATALEN, oldrelname); oldrelname);
return; return;
} }
if (IsSystemRelationName(newrelname)) { if (IsSystemRelationName(newrelname)) {
elog(WARN, "renamerel: Illegal class name: \"%-.*s\" -- pg_ is reserved for system catalogs", elog(WARN, "renamerel: Illegal class name: \"%s\" -- pg_ is reserved for system catalogs",
NAMEDATALEN, newrelname); newrelname);
return; return;
} }
...@@ -222,16 +222,16 @@ renamerel(char oldrelname[], char newrelname[]) ...@@ -222,16 +222,16 @@ renamerel(char oldrelname[], char newrelname[])
if (!PointerIsValid(oldreltup)) { if (!PointerIsValid(oldreltup)) {
heap_close(relrdesc); heap_close(relrdesc);
elog(WARN, "renamerel: relation \"%-.*s\" does not exist", elog(WARN, "renamerel: relation \"%s\" does not exist",
NAMEDATALEN, oldrelname); oldrelname);
} }
newreltup = ClassNameIndexScan(relrdesc, newrelname); newreltup = ClassNameIndexScan(relrdesc, newrelname);
if (PointerIsValid(newreltup)) { if (PointerIsValid(newreltup)) {
pfree(oldreltup); pfree(oldreltup);
heap_close(relrdesc); heap_close(relrdesc);
elog(WARN, "renamerel: relation \"%-.*s\" exists", elog(WARN, "renamerel: relation \"%s\" exists",
NAMEDATALEN, newrelname); newrelname);
} }
/* rename the directory first, so if this fails the rename's not done */ /* rename the directory first, so if this fails the rename's not done */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.38 1997/08/12 22:52:29 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.39 1997/08/18 20:52:21 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -318,8 +318,8 @@ vc_getrels(NameData *VacRelP) ...@@ -318,8 +318,8 @@ vc_getrels(NameData *VacRelP)
(rname[3] == 'v' || rname[3] == 'x') && (rname[3] == 'v' || rname[3] == 'x') &&
rname[4] >= '0' && rname[4] <= '9') rname[4] >= '0' && rname[4] <= '9')
{ {
elog (NOTICE, "Rel %.*s: can't vacuum LargeObjects now", elog (NOTICE, "Rel %s: can't vacuum LargeObjects now",
NAMEDATALEN, rname); rname);
ReleaseBuffer(buf); ReleaseBuffer(buf);
continue; continue;
} }
...@@ -446,8 +446,8 @@ vc_vacone (Oid relid, bool analyze, List *va_cols) ...@@ -446,8 +446,8 @@ vc_vacone (Oid relid, bool analyze, List *va_cols)
List *le; List *le;
if ( length (va_cols) > attr_cnt ) if ( length (va_cols) > attr_cnt )
elog (WARN, "vacuum: too many attributes specified for relation %.*s", elog (WARN, "vacuum: too many attributes specified for relation %s",
NAMEDATALEN, (RelationGetRelationName(onerel))->data); (RelationGetRelationName(onerel))->data);
attnums = (int*) palloc (attr_cnt * sizeof (int)); attnums = (int*) palloc (attr_cnt * sizeof (int));
foreach (le, va_cols) foreach (le, va_cols)
{ {
...@@ -462,8 +462,8 @@ vc_vacone (Oid relid, bool analyze, List *va_cols) ...@@ -462,8 +462,8 @@ vc_vacone (Oid relid, bool analyze, List *va_cols)
attnums[tcnt++] = i; attnums[tcnt++] = i;
else else
{ {
elog (WARN, "vacuum: there is no attribute %s in %.*s", elog (WARN, "vacuum: there is no attribute %s in %s",
col, NAMEDATALEN, (RelationGetRelationName(onerel))->data); col, (RelationGetRelationName(onerel))->data);
} }
} }
attr_cnt = tcnt; attr_cnt = tcnt;
...@@ -657,8 +657,8 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel, ...@@ -657,8 +657,8 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel,
vpc->vpd_noff = 0; vpc->vpd_noff = 0;
if (PageIsNew(page)) { if (PageIsNew(page)) {
elog (NOTICE, "Rel %.*s: Uninitialized page %u - fixing", elog (NOTICE, "Rel %s: Uninitialized page %u - fixing",
NAMEDATALEN, relname, blkno); relname, blkno);
PageInit (page, BufferGetPageSize (buf), 0); PageInit (page, BufferGetPageSize (buf), 0);
vpc->vpd_free = ((PageHeader)page)->pd_upper - ((PageHeader)page)->pd_lower; vpc->vpd_free = ((PageHeader)page)->pd_upper - ((PageHeader)page)->pd_lower;
frsize += (vpc->vpd_free - sizeof (ItemIdData)); frsize += (vpc->vpd_free - sizeof (ItemIdData));
...@@ -718,8 +718,8 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel, ...@@ -718,8 +718,8 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel,
} }
else else
{ {
elog (NOTICE, "Rel %.*s: TID %u/%u: InsertTransactionInProgress %u - can't shrink relation", elog (NOTICE, "Rel %s: TID %u/%u: InsertTransactionInProgress %u - can't shrink relation",
NAMEDATALEN, relname, blkno, offnum, htup->t_xmin); relname, blkno, offnum, htup->t_xmin);
do_shrinking = false; do_shrinking = false;
} }
} }
...@@ -743,8 +743,8 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel, ...@@ -743,8 +743,8 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel,
} }
else else
{ {
elog (NOTICE, "Rel %.*s: TID %u/%u: DeleteTransactionInProgress %u - can't shrink relation", elog (NOTICE, "Rel %s: TID %u/%u: DeleteTransactionInProgress %u - can't shrink relation",
NAMEDATALEN, relname, blkno, offnum, htup->t_xmax); relname, blkno, offnum, htup->t_xmax);
do_shrinking = false; do_shrinking = false;
} }
} }
...@@ -754,9 +754,9 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel, ...@@ -754,9 +754,9 @@ vc_scanheap (VRelStats *vacrelstats, Relation onerel,
*/ */
if ( !TransactionIdIsValid((TransactionId)htup->t_xmin) ) if ( !TransactionIdIsValid((TransactionId)htup->t_xmin) )
{ {
elog (NOTICE, "Rel %.*s: TID %u/%u: INSERT_TRANSACTION_ID IS INVALID. \ elog (NOTICE, "Rel %s: TID %u/%u: INSERT_TRANSACTION_ID IS INVALID. \
DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.", DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.",
NAMEDATALEN, relname, blkno, offnum, relname, blkno, offnum,
TransactionIdIsValid((TransactionId)htup->t_xmax), TransactionIdIsValid((TransactionId)htup->t_xmax),
tupgone); tupgone);
} }
...@@ -769,8 +769,8 @@ DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.", ...@@ -769,8 +769,8 @@ DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.",
if ( !ItemPointerIsValid (itemptr) || if ( !ItemPointerIsValid (itemptr) ||
BlockIdGetBlockNumber(&(itemptr->ip_blkid)) != blkno ) BlockIdGetBlockNumber(&(itemptr->ip_blkid)) != blkno )
{ {
elog (NOTICE, "Rel %.*s: TID %u/%u: TID IN TUPLEHEADER %u/%u IS NOT THE SAME. TUPGONE %d.", elog (NOTICE, "Rel %s: TID %u/%u: TID IN TUPLEHEADER %u/%u IS NOT THE SAME. TUPGONE %d.",
NAMEDATALEN, relname, blkno, offnum, relname, blkno, offnum,
BlockIdGetBlockNumber(&(itemptr->ip_blkid)), BlockIdGetBlockNumber(&(itemptr->ip_blkid)),
itemptr->ip_posid, tupgone); itemptr->ip_posid, tupgone);
} }
...@@ -780,14 +780,14 @@ DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.", ...@@ -780,14 +780,14 @@ DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.",
*/ */
if ( htup->t_len != itemid->lp_len ) if ( htup->t_len != itemid->lp_len )
{ {
elog (NOTICE, "Rel %.*s: TID %u/%u: TUPLE_LEN IN PAGEHEADER %u IS NOT THE SAME AS IN TUPLEHEADER %u. TUPGONE %d.", elog (NOTICE, "Rel %s: TID %u/%u: TUPLE_LEN IN PAGEHEADER %u IS NOT THE SAME AS IN TUPLEHEADER %u. TUPGONE %d.",
NAMEDATALEN, relname, blkno, offnum, relname, blkno, offnum,
itemid->lp_len, htup->t_len, tupgone); itemid->lp_len, htup->t_len, tupgone);
} }
if ( !OidIsValid(htup->t_oid) ) if ( !OidIsValid(htup->t_oid) )
{ {
elog (NOTICE, "Rel %.*s: TID %u/%u: OID IS INVALID. TUPGONE %d.", elog (NOTICE, "Rel %s: TID %u/%u: OID IS INVALID. TUPGONE %d.",
NAMEDATALEN, relname, blkno, offnum, tupgone); relname, blkno, offnum, tupgone);
} }
if (tupgone) { if (tupgone) {
...@@ -890,9 +890,9 @@ DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.", ...@@ -890,9 +890,9 @@ DELETE_TRANSACTION_ID_VALID %d, TUPGONE %d.",
getrusage(RUSAGE_SELF, &ru1); getrusage(RUSAGE_SELF, &ru1);
elog (MESSAGE_LEVEL, "Rel %.*s: Pages %u: Changed %u, Reapped %u, Empty %u, New %u; \ elog (MESSAGE_LEVEL, "Rel %s: Pages %u: Changed %u, Reapped %u, Empty %u, New %u; \
Tup %u: Vac %u, Crash %u, UnUsed %u, MinLen %u, MaxLen %u; Re-using: Free/Avail. Space %u/%u; EndEmpty/Avail. Pages %u/%u. Elapsed %u/%u sec.", Tup %u: Vac %u, Crash %u, UnUsed %u, MinLen %u, MaxLen %u; Re-using: Free/Avail. Space %u/%u; EndEmpty/Avail. Pages %u/%u. Elapsed %u/%u sec.",
NAMEDATALEN, relname, relname,
nblocks, nchpg, Vvpl->vpl_npages, nempg, nnepg, nblocks, nchpg, Vvpl->vpl_npages, nempg, nnepg,
ntups, nvac, ncrash, nunused, min_tlen, max_tlen, ntups, nvac, ncrash, nunused, min_tlen, max_tlen,
frsize, frsusf, nemend, Fvpl->vpl_npages, frsize, frsusf, nemend, Fvpl->vpl_npages,
...@@ -1246,9 +1246,9 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)", ...@@ -1246,9 +1246,9 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
getrusage(RUSAGE_SELF, &ru1); getrusage(RUSAGE_SELF, &ru1);
elog (MESSAGE_LEVEL, "Rel %.*s: Pages: %u --> %u; Tuple(s) moved: %u. \ elog (MESSAGE_LEVEL, "Rel %s: Pages: %u --> %u; Tuple(s) moved: %u. \
Elapsed %u/%u sec.", Elapsed %u/%u sec.",
NAMEDATALEN, (RelationGetRelationName(onerel))->data, (RelationGetRelationName(onerel))->data,
nblocks, blkno, nmoved, nblocks, blkno, nmoved,
ru1.ru_stime.tv_sec - ru0.ru_stime.tv_sec, ru1.ru_stime.tv_sec - ru0.ru_stime.tv_sec,
ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec); ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec);
...@@ -1371,8 +1371,8 @@ vc_vacheap (VRelStats *vacrelstats, Relation onerel, VPageList Vvpl) ...@@ -1371,8 +1371,8 @@ vc_vacheap (VRelStats *vacrelstats, Relation onerel, VPageList Vvpl)
{ {
Assert ( vacrelstats->npages >= Vvpl->vpl_nemend ); Assert ( vacrelstats->npages >= Vvpl->vpl_nemend );
nblocks = vacrelstats->npages - Vvpl->vpl_nemend; nblocks = vacrelstats->npages - Vvpl->vpl_nemend;
elog (MESSAGE_LEVEL, "Rel %.*s: Pages: %u --> %u.", elog (MESSAGE_LEVEL, "Rel %s: Pages: %u --> %u.",
NAMEDATALEN, (RelationGetRelationName(onerel))->data, (RelationGetRelationName(onerel))->data,
vacrelstats->npages, nblocks); vacrelstats->npages, nblocks);
/* /*
...@@ -1451,14 +1451,14 @@ vc_scanoneind (Relation indrel, int nhtups) ...@@ -1451,14 +1451,14 @@ vc_scanoneind (Relation indrel, int nhtups)
getrusage(RUSAGE_SELF, &ru1); getrusage(RUSAGE_SELF, &ru1);
elog (MESSAGE_LEVEL, "Ind %.*s: Pages %u; Tuples %u. Elapsed %u/%u sec.", elog (MESSAGE_LEVEL, "Ind %s: Pages %u; Tuples %u. Elapsed %u/%u sec.",
NAMEDATALEN, indrel->rd_rel->relname.data, nipages, nitups, indrel->rd_rel->relname.data, nipages, nitups,
ru1.ru_stime.tv_sec - ru0.ru_stime.tv_sec, ru1.ru_stime.tv_sec - ru0.ru_stime.tv_sec,
ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec); ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec);
if ( nitups != nhtups ) if ( nitups != nhtups )
elog (NOTICE, "Ind %.*s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u)", elog (NOTICE, "Ind %s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u)",
NAMEDATALEN, indrel->rd_rel->relname.data, nitups, nhtups); indrel->rd_rel->relname.data, nitups, nhtups);
} /* vc_scanoneind */ } /* vc_scanoneind */
...@@ -1508,8 +1508,8 @@ vc_vaconeind(VPageList vpl, Relation indrel, int nhtups) ...@@ -1508,8 +1508,8 @@ vc_vaconeind(VPageList vpl, Relation indrel, int nhtups)
#endif #endif
if ( vp->vpd_noff == 0 ) if ( vp->vpd_noff == 0 )
{ /* this is EmptyPage !!! */ { /* this is EmptyPage !!! */
elog (NOTICE, "Ind %.*s: pointer to EmptyPage (blk %u off %u) - fixing", elog (NOTICE, "Ind %s: pointer to EmptyPage (blk %u off %u) - fixing",
NAMEDATALEN, indrel->rd_rel->relname.data, indrel->rd_rel->relname.data,
vp->vpd_blkno, ItemPointerGetOffsetNumber(heapptr)); vp->vpd_blkno, ItemPointerGetOffsetNumber(heapptr));
} }
++nvac; ++nvac;
...@@ -1530,14 +1530,14 @@ vc_vaconeind(VPageList vpl, Relation indrel, int nhtups) ...@@ -1530,14 +1530,14 @@ vc_vaconeind(VPageList vpl, Relation indrel, int nhtups)
getrusage(RUSAGE_SELF, &ru1); getrusage(RUSAGE_SELF, &ru1);
elog (MESSAGE_LEVEL, "Ind %.*s: Pages %u; Tuples %u: Deleted %u. Elapsed %u/%u sec.", elog (MESSAGE_LEVEL, "Ind %s: Pages %u; Tuples %u: Deleted %u. Elapsed %u/%u sec.",
NAMEDATALEN, indrel->rd_rel->relname.data, nipages, nitups, nvac, indrel->rd_rel->relname.data, nipages, nitups, nvac,
ru1.ru_stime.tv_sec - ru0.ru_stime.tv_sec, ru1.ru_stime.tv_sec - ru0.ru_stime.tv_sec,
ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec); ru1.ru_utime.tv_sec - ru0.ru_utime.tv_sec);
if ( nitups != nhtups ) if ( nitups != nhtups )
elog (NOTICE, "Ind %.*s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u)", elog (NOTICE, "Ind %s: NUMBER OF INDEX' TUPLES (%u) IS NOT THE SAME AS HEAP' (%u)",
NAMEDATALEN, indrel->rd_rel->relname.data, nitups, nhtups); indrel->rd_rel->relname.data, nitups, nhtups);
} /* vc_vaconeind */ } /* vc_vaconeind */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.14 1997/08/12 22:52:33 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.15 1997/08/18 20:52:25 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -308,9 +308,9 @@ ExecCheckPerms(CmdType operation, ...@@ -308,9 +308,9 @@ ExecCheckPerms(CmdType operation,
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "ExecCheckPerms: bogus RT relid: %d", elog(WARN, "ExecCheckPerms: bogus RT relid: %d",
relid); relid);
strncpy(rname.data, strNcpy(rname.data,
((Form_pg_class) GETSTRUCT(htp))->relname.data, ((Form_pg_class) GETSTRUCT(htp))->relname.data,
NAMEDATALEN); NAMEDATALEN-1);
if (i == resultRelation) { /* this is the result relation */ if (i == resultRelation) { /* this is the result relation */
qvars = pull_varnos(parseTree->qual); qvars = pull_varnos(parseTree->qual);
tvars = pull_varnos((Node*)parseTree->targetList); tvars = pull_varnos((Node*)parseTree->targetList);
...@@ -348,10 +348,6 @@ ExecCheckPerms(CmdType operation, ...@@ -348,10 +348,6 @@ ExecCheckPerms(CmdType operation,
++i; ++i;
} }
if (!ok) { if (!ok) {
/*
elog(WARN, "%s on \"%-.*s\": permission denied", opstr,
NAMEDATALEN, rname.data);
*/
elog(WARN, "%s: %s", rname.data, aclcheck_error_strings[aclcheck_result]); elog(WARN, "%s: %s", rname.data, aclcheck_error_strings[aclcheck_result]);
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.9 1997/06/13 03:24:26 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.10 1997/08/18 20:52:27 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -491,7 +491,7 @@ ExecSetTypeInfo(int index, ...@@ -491,7 +491,7 @@ ExecSetTypeInfo(int index,
att->attrelid = 0; /* dummy value */ att->attrelid = 0; /* dummy value */
if (attName != (char *) NULL) if (attName != (char *) NULL)
strncpy(att->attname.data, attName, NAMEDATALEN); strNcpy(att->attname.data, attName, NAMEDATALEN-1);
else else
memset(att->attname.data,0,NAMEDATALEN); memset(att->attname.data,0,NAMEDATALEN);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.4 1996/11/10 03:00:23 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/Attic/be-dumpdata.c,v 1.5 1997/08/18 20:52:31 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.5 1996/12/26 17:46:56 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.6 1997/08/18 20:52:43 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
...@@ -501,7 +501,7 @@ _outResdom(StringInfo str, Resdom *node) ...@@ -501,7 +501,7 @@ _outResdom(StringInfo str, Resdom *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reslen %d", node->reslen); sprintf(buf, " :reslen %d", node->reslen);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :resname \"%.*s\"", NAMEDATALEN, sprintf(buf, " :resname \"%s\"",
((node->resname) ? ((char *) node->resname) : "null")); ((node->resname) ? ((char *) node->resname) : "null"));
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :reskey %d", node->reskey); sprintf(buf, " :reskey %d", node->reskey);
...@@ -643,7 +643,7 @@ _outAggreg(StringInfo str, Aggreg *node) ...@@ -643,7 +643,7 @@ _outAggreg(StringInfo str, Aggreg *node)
sprintf(buf, "AGGREG"); sprintf(buf, "AGGREG");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :aggname \"%.*s\"", NAMEDATALEN, (char*)node->aggname); sprintf(buf, " :aggname \"%s\"", (char*)node->aggname);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :basetype %u", node->basetype); sprintf(buf, " :basetype %u", node->basetype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -789,7 +789,7 @@ _outParam(StringInfo str, Param *node) ...@@ -789,7 +789,7 @@ _outParam(StringInfo str, Param *node)
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :paramid %hd", node->paramid); sprintf(buf, " :paramid %hd", node->paramid);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :paramname \"%.*s\"", NAMEDATALEN, node->paramname); sprintf(buf, " :paramname \"%s\"", node->paramname);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :paramtype %u", node->paramtype); sprintf(buf, " :paramtype %u", node->paramtype);
appendStringInfo(str,buf); appendStringInfo(str,buf);
...@@ -932,14 +932,14 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node) ...@@ -932,14 +932,14 @@ _outRangeTblEntry(StringInfo str, RangeTblEntry *node)
sprintf(buf, "RTE"); sprintf(buf, "RTE");
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :relname \"%.*s\"", NAMEDATALEN, sprintf(buf, " :relname \"%s\"",
((node->relname) ? ((char *) node->relname) : "null")); ((node->relname) ? ((char *) node->relname) : "null"));
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :inh %d ", node->inh); sprintf(buf, " :inh %d ", node->inh);
appendStringInfo(str,buf); appendStringInfo(str,buf);
sprintf(buf, " :refname \"%.*s\"", NAMEDATALEN, sprintf(buf, " :refname \"%s\"",
((node->refname) ? ((char *) node->refname) : "null")); ((node->refname) ? ((char *) node->refname) : "null"));
appendStringInfo(str,buf); appendStringInfo(str,buf);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.32 1997/08/12 22:53:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.33 1997/08/18 20:53:00 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1374,10 +1374,10 @@ make_targetlist_expr(ParseState *pstate, ...@@ -1374,10 +1374,10 @@ make_targetlist_expr(ParseState *pstate,
attrlen); attrlen);
} else { } else {
/* currently, we can't handle casting of expressions */ /* currently, we can't handle casting of expressions */
elog(WARN, "parser: attribute '%s' is of type '%.*s' but expression is of type '%.*s'", elog(WARN, "parser: attribute '%s' is of type '%s' but expression is of type '%s'",
colname, colname,
NAMEDATALEN, get_id_typname(attrtype), get_id_typname(attrtype),
NAMEDATALEN, get_id_typname(type_id)); get_id_typname(type_id));
} }
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.4 1997/08/18 02:14:44 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/Attic/dbcommands.c,v 1.5 1997/08/18 20:53:03 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -170,8 +170,8 @@ check_permissions(char *command, ...@@ -170,8 +170,8 @@ check_permissions(char *command,
/* Check to make sure user has permission to use createdb */ /* Check to make sure user has permission to use createdb */
if (!use_createdb) { if (!use_createdb) {
elog(WARN, "user \"%-.*s\" is not allowed to create/destroy databases", elog(WARN, "user \"%s\" is not allowed to create/destroy databases",
NAMEDATALEN, userName); userName);
} }
/* Make sure we are not mucking with the template database */ /* Make sure we are not mucking with the template database */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.17 1997/08/18 02:14:49 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.18 1997/08/18 20:53:08 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1419,9 +1419,9 @@ PrintBufferDescs() ...@@ -1419,9 +1419,9 @@ PrintBufferDescs()
if (IsUnderPostmaster) { if (IsUnderPostmaster) {
SpinAcquire(BufMgrLock); SpinAcquire(BufMgrLock);
for (i = 0; i < NBuffers; ++i, ++buf) { for (i = 0; i < NBuffers; ++i, ++buf) {
elog(NOTICE, "[%02d] (freeNext=%d, freePrev=%d, relname=%.*s, \ elog(NOTICE, "[%02d] (freeNext=%d, freePrev=%d, relname=%s, \
blockNum=%d, flags=0x%x, refcount=%d %d)", blockNum=%d, flags=0x%x, refcount=%d %d)",
i, buf->freeNext, buf->freePrev, NAMEDATALEN, i, buf->freeNext, buf->freePrev,
buf->sb_relname, buf->tag.blockNum, buf->flags, buf->sb_relname, buf->tag.blockNum, buf->flags,
buf->refcount, PrivateRefCount[i]); buf->refcount, PrivateRefCount[i]);
} }
...@@ -1445,9 +1445,9 @@ PrintPinnedBufs() ...@@ -1445,9 +1445,9 @@ PrintPinnedBufs()
SpinAcquire(BufMgrLock); SpinAcquire(BufMgrLock);
for (i = 0; i < NBuffers; ++i, ++buf) { for (i = 0; i < NBuffers; ++i, ++buf) {
if (PrivateRefCount[i] > 0) if (PrivateRefCount[i] > 0)
elog(NOTICE, "[%02d] (freeNext=%d, freePrev=%d, relname=%.*s, \ elog(NOTICE, "[%02d] (freeNext=%d, freePrev=%d, relname=%s, \
blockNum=%d, flags=0x%x, refcount=%d %d)\n", blockNum=%d, flags=0x%x, refcount=%d %d)\n",
i, buf->freeNext, buf->freePrev, NAMEDATALEN, buf->sb_relname, i, buf->freeNext, buf->freePrev, buf->sb_relname,
buf->tag.blockNum, buf->flags, buf->tag.blockNum, buf->flags,
buf->refcount, PrivateRefCount[i]); buf->refcount, PrivateRefCount[i]);
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.17 1997/08/12 22:54:13 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.18 1997/08/18 20:53:14 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -468,17 +468,17 @@ mdblindwrt(char *dbstr, ...@@ -468,17 +468,17 @@ mdblindwrt(char *dbstr,
if (dbid == (Oid) 0) { if (dbid == (Oid) 0) {
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2 + nchars); path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2 + nchars);
if (segno == 0) if (segno == 0)
sprintf(path, "%s/%.*s", DataDir, NAMEDATALEN, relstr); sprintf(path, "%s/%s", DataDir, relstr);
else else
sprintf(path, "%s/%.*s.%d", DataDir, NAMEDATALEN, relstr, segno); sprintf(path, "%s/%s.%d", DataDir, relstr, segno);
} else { } else {
path = (char *) palloc(strlen(DataDir) + strlen("/base/") + 2 * sizeof(NameData) + 2 + nchars); path = (char *) palloc(strlen(DataDir) + strlen("/base/") + 2 * sizeof(NameData) + 2 + nchars);
if (segno == 0) if (segno == 0)
sprintf(path, "%s/base/%.*s/%.*s", DataDir, NAMEDATALEN, sprintf(path, "%s/base/%s/%s", DataDir,
dbstr, NAMEDATALEN, relstr); dbstr, relstr);
else else
sprintf(path, "%s/base/%.*s/%.*s.%d", DataDir, NAMEDATALEN, dbstr, sprintf(path, "%s/base/%s/%s.%d", DataDir, dbstr,
NAMEDATALEN, relstr, segno); relstr, segno);
} }
if ((fd = open(path, O_RDWR, 0600)) < 0) if ((fd = open(path, O_RDWR, 0600)) < 0)
...@@ -563,8 +563,8 @@ mdtruncate (Relation reln, int nblocks) ...@@ -563,8 +563,8 @@ mdtruncate (Relation reln, int nblocks)
curnblk = mdnblocks (reln); curnblk = mdnblocks (reln);
if ( curnblk / RELSEG_SIZE > 0 ) if ( curnblk / RELSEG_SIZE > 0 )
{ {
elog (NOTICE, "Can't truncate multi-segments relation %.*s", elog (NOTICE, "Can't truncate multi-segments relation %s",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (curnblk); return (curnblk);
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.6 1997/05/22 17:08:35 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/smgr.c,v 1.7 1997/08/18 20:53:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -125,8 +125,8 @@ smgrcreate(int16 which, Relation reln) ...@@ -125,8 +125,8 @@ smgrcreate(int16 which, Relation reln)
int fd; int fd;
if ((fd = (*(smgrsw[which].smgr_create))(reln)) < 0) if ((fd = (*(smgrsw[which].smgr_create))(reln)) < 0)
elog(WARN, "cannot open %.*s", elog(WARN, "cannot open %s",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (fd); return (fd);
} }
...@@ -142,8 +142,8 @@ smgrunlink(int16 which, Relation reln) ...@@ -142,8 +142,8 @@ smgrunlink(int16 which, Relation reln)
int status; int status;
if ((status = (*(smgrsw[which].smgr_unlink))(reln)) == SM_FAIL) if ((status = (*(smgrsw[which].smgr_unlink))(reln)) == SM_FAIL)
elog(WARN, "cannot unlink %.*s", elog(WARN, "cannot unlink %s",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (status); return (status);
} }
...@@ -162,8 +162,8 @@ smgrextend(int16 which, Relation reln, char *buffer) ...@@ -162,8 +162,8 @@ smgrextend(int16 which, Relation reln, char *buffer)
status = (*(smgrsw[which].smgr_extend))(reln, buffer); status = (*(smgrsw[which].smgr_extend))(reln, buffer);
if (status == SM_FAIL) if (status == SM_FAIL)
elog(WARN, "%.*s: cannot extend", elog(WARN, "%s: cannot extend",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (status); return (status);
} }
...@@ -180,8 +180,8 @@ smgropen(int16 which, Relation reln) ...@@ -180,8 +180,8 @@ smgropen(int16 which, Relation reln)
int fd; int fd;
if ((fd = (*(smgrsw[which].smgr_open))(reln)) < 0) if ((fd = (*(smgrsw[which].smgr_open))(reln)) < 0)
elog(WARN, "cannot open %.*s", elog(WARN, "cannot open %s",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (fd); return (fd);
} }
...@@ -202,8 +202,8 @@ int ...@@ -202,8 +202,8 @@ int
smgrclose(int16 which, Relation reln) smgrclose(int16 which, Relation reln)
{ {
if ((*(smgrsw[which].smgr_close))(reln) == SM_FAIL) if ((*(smgrsw[which].smgr_close))(reln) == SM_FAIL)
elog(WARN, "cannot close %.*s", elog(WARN, "cannot close %s",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (SM_SUCCESS); return (SM_SUCCESS);
} }
...@@ -226,8 +226,8 @@ smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer) ...@@ -226,8 +226,8 @@ smgrread(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
status = (*(smgrsw[which].smgr_read))(reln, blocknum, buffer); status = (*(smgrsw[which].smgr_read))(reln, blocknum, buffer);
if (status == SM_FAIL) if (status == SM_FAIL)
elog(WARN, "cannot read block %d of %.*s", elog(WARN, "cannot read block %d of %s",
blocknum, NAMEDATALEN, &(reln->rd_rel->relname.data[0])); blocknum, &(reln->rd_rel->relname.data[0]));
return (status); return (status);
} }
...@@ -248,8 +248,8 @@ smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer) ...@@ -248,8 +248,8 @@ smgrwrite(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
status = (*(smgrsw[which].smgr_write))(reln, blocknum, buffer); status = (*(smgrsw[which].smgr_write))(reln, blocknum, buffer);
if (status == SM_FAIL) if (status == SM_FAIL)
elog(WARN, "cannot write block %d of %.*s", elog(WARN, "cannot write block %d of %s",
blocknum, NAMEDATALEN, &(reln->rd_rel->relname.data[0])); blocknum, &(reln->rd_rel->relname.data[0]));
return (status); return (status);
} }
...@@ -265,8 +265,8 @@ smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer) ...@@ -265,8 +265,8 @@ smgrflush(int16 which, Relation reln, BlockNumber blocknum, char *buffer)
status = (*(smgrsw[which].smgr_flush))(reln, blocknum, buffer); status = (*(smgrsw[which].smgr_flush))(reln, blocknum, buffer);
if (status == SM_FAIL) if (status == SM_FAIL)
elog(WARN, "cannot flush block %d of %.*s to stable store", elog(WARN, "cannot flush block %d of %s to stable store",
blocknum, NAMEDATALEN, &(reln->rd_rel->relname.data[0])); blocknum, &(reln->rd_rel->relname.data[0]));
return (status); return (status);
} }
...@@ -325,8 +325,8 @@ smgrnblocks(int16 which, Relation reln) ...@@ -325,8 +325,8 @@ smgrnblocks(int16 which, Relation reln)
int nblocks; int nblocks;
if ((nblocks = (*(smgrsw[which].smgr_nblocks))(reln)) < 0) if ((nblocks = (*(smgrsw[which].smgr_nblocks))(reln)) < 0)
elog(WARN, "cannot count blocks for %.*s", elog(WARN, "cannot count blocks for %s",
NAMEDATALEN, &(reln->rd_rel->relname.data[0])); &(reln->rd_rel->relname.data[0]));
return (nblocks); return (nblocks);
} }
...@@ -347,8 +347,8 @@ smgrtruncate(int16 which, Relation reln, int nblocks) ...@@ -347,8 +347,8 @@ smgrtruncate(int16 which, Relation reln, int nblocks)
if (smgrsw[which].smgr_truncate) if (smgrsw[which].smgr_truncate)
{ {
if ((newblks = (*(smgrsw[which].smgr_truncate))(reln, nblocks)) < 0) if ((newblks = (*(smgrsw[which].smgr_truncate))(reln, nblocks)) < 0)
elog(WARN, "cannot truncate %.*s to %d blocks", elog(WARN, "cannot truncate %s to %d blocks",
NAMEDATALEN, &(reln->rd_rel->relname.data[0]), nblocks); &(reln->rd_rel->relname.data[0]), nblocks);
} }
return (newblks); return (newblks);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.11 1997/08/12 22:54:17 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/Attic/aclchk.c,v 1.12 1997/08/18 20:53:29 momjian Exp $
* *
* NOTES * NOTES
* See acl.h. * See acl.h.
...@@ -356,8 +356,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode) ...@@ -356,8 +356,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0,0,0); 0,0,0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_aclcheck: user \"%-.*s\" not found", elog(WARN, "pg_aclcheck: user \"%s\" not found",
NAMEDATALEN, usename); usename);
id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
/* for the 'pg_database' relation, check the usecreatedb /* for the 'pg_database' relation, check the usecreatedb
...@@ -379,8 +379,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode) ...@@ -379,8 +379,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
if (((mode & ACL_WR) || (mode & ACL_AP)) && if (((mode & ACL_WR) || (mode & ACL_AP)) &&
IsSystemRelationName(relname) && IsSystemRelationName(relname) &&
!((Form_pg_user) GETSTRUCT(htp))->usecatupd) { !((Form_pg_user) GETSTRUCT(htp))->usecatupd) {
elog(DEBUG, "pg_aclcheck: catalog update to \"%-.*s\": permission denied", elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
NAMEDATALEN, relname); relname);
return ACLCHECK_NO_PRIV; return ACLCHECK_NO_PRIV;
} }
...@@ -389,8 +389,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode) ...@@ -389,8 +389,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
*/ */
if (((Form_pg_user) GETSTRUCT(htp))->usesuper) { if (((Form_pg_user) GETSTRUCT(htp))->usesuper) {
#ifdef ACLDEBUG_TRACE #ifdef ACLDEBUG_TRACE
elog(DEBUG, "pg_aclcheck: \"%-.*s\" is superuser", elog(DEBUG, "pg_aclcheck: \"%s\" is superuser",
NAMEDATALEN, usename); usename);
#endif #endif
return ACLCHECK_OK; return ACLCHECK_OK;
} }
...@@ -399,8 +399,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode) ...@@ -399,8 +399,8 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
htp = SearchSysCacheTuple(RELNAME, PointerGetDatum(relname), htp = SearchSysCacheTuple(RELNAME, PointerGetDatum(relname),
0,0,0); 0,0,0);
if (!HeapTupleIsValid(htp)) { if (!HeapTupleIsValid(htp)) {
elog(WARN, "pg_aclcheck: class \"%-.*s\" not found", elog(WARN, "pg_aclcheck: class \"%s\" not found",
NAMEDATALEN, relname); relname);
/* an elog(WARN) kills us, so no need to return anything. */ /* an elog(WARN) kills us, so no need to return anything. */
} }
if (!heap_attisnull(htp, Anum_pg_class_relacl)) { if (!heap_attisnull(htp, Anum_pg_class_relacl)) {
...@@ -472,8 +472,8 @@ pg_ownercheck(char *usename, ...@@ -472,8 +472,8 @@ pg_ownercheck(char *usename,
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0,0,0); 0,0,0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_ownercheck: user \"%-.*s\" not found", elog(WARN, "pg_ownercheck: user \"%s\" not found",
NAMEDATALEN, usename); usename);
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
/* /*
...@@ -481,8 +481,8 @@ pg_ownercheck(char *usename, ...@@ -481,8 +481,8 @@ pg_ownercheck(char *usename,
*/ */
if (((Form_pg_user) GETSTRUCT(htp))->usesuper) { if (((Form_pg_user) GETSTRUCT(htp))->usesuper) {
#ifdef ACLDEBUG_TRACE #ifdef ACLDEBUG_TRACE
elog(DEBUG, "pg_ownercheck: user \"%-.*s\" is superuser", elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser",
NAMEDATALEN, usename); usename);
#endif #endif
return(1); return(1);
} }
...@@ -498,20 +498,20 @@ pg_ownercheck(char *usename, ...@@ -498,20 +498,20 @@ pg_ownercheck(char *usename,
break; break;
case PRONAME: case PRONAME:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_ownercheck: function \"%-.*s\" not found", elog(WARN, "pg_ownercheck: function \"%s\" not found",
NAMEDATALEN, value); value);
owner_id = ((Form_pg_proc) GETSTRUCT(htp))->proowner; owner_id = ((Form_pg_proc) GETSTRUCT(htp))->proowner;
break; break;
case RELNAME: case RELNAME:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_ownercheck: class \"%-.*s\" not found", elog(WARN, "pg_ownercheck: class \"%s\" not found",
NAMEDATALEN, value); value);
owner_id = ((Form_pg_class) GETSTRUCT(htp))->relowner; owner_id = ((Form_pg_class) GETSTRUCT(htp))->relowner;
break; break;
case TYPNAME: case TYPNAME:
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_ownercheck: type \"%-.*s\" not found", elog(WARN, "pg_ownercheck: type \"%s\" not found",
NAMEDATALEN, value); value);
owner_id = ((TypeTupleForm) GETSTRUCT(htp))->typowner; owner_id = ((TypeTupleForm) GETSTRUCT(htp))->typowner;
break; break;
default: default:
...@@ -535,8 +535,8 @@ pg_func_ownercheck(char *usename, ...@@ -535,8 +535,8 @@ pg_func_ownercheck(char *usename,
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0,0,0); 0,0,0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_func_ownercheck: user \"%-.*s\" not found", elog(WARN, "pg_func_ownercheck: user \"%s\" not found",
NAMEDATALEN, usename); usename);
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
/* /*
...@@ -544,8 +544,8 @@ pg_func_ownercheck(char *usename, ...@@ -544,8 +544,8 @@ pg_func_ownercheck(char *usename,
*/ */
if (((Form_pg_user) GETSTRUCT(htp))->usesuper) { if (((Form_pg_user) GETSTRUCT(htp))->usesuper) {
#ifdef ACLDEBUG_TRACE #ifdef ACLDEBUG_TRACE
elog(DEBUG, "pg_ownercheck: user \"%-.*s\" is superuser", elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser",
NAMEDATALEN, usename); usename);
#endif #endif
return(1); return(1);
} }
...@@ -574,8 +574,8 @@ pg_aggr_ownercheck(char *usename, ...@@ -574,8 +574,8 @@ pg_aggr_ownercheck(char *usename,
htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename), htp = SearchSysCacheTuple(USENAME, PointerGetDatum(usename),
0,0,0); 0,0,0);
if (!HeapTupleIsValid(htp)) if (!HeapTupleIsValid(htp))
elog(WARN, "pg_aggr_ownercheck: user \"%-.*s\" not found", elog(WARN, "pg_aggr_ownercheck: user \"%s\" not found",
NAMEDATALEN, usename); usename);
user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid; user_id = (AclId) ((Form_pg_user) GETSTRUCT(htp))->usesysid;
/* /*
...@@ -583,8 +583,8 @@ pg_aggr_ownercheck(char *usename, ...@@ -583,8 +583,8 @@ pg_aggr_ownercheck(char *usename,
*/ */
if (((Form_pg_user) GETSTRUCT(htp))->usesuper) { if (((Form_pg_user) GETSTRUCT(htp))->usesuper) {
#ifdef ACLDEBUG_TRACE #ifdef ACLDEBUG_TRACE
elog(DEBUG, "pg_aggr_ownercheck: user \"%-.*s\" is superuser", elog(DEBUG, "pg_aggr_ownercheck: user \"%s\" is superuser",
NAMEDATALEN, usename); usename);
#endif #endif
return(1); return(1);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.19 1997/08/18 02:14:52 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.20 1997/08/18 20:53:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -171,8 +171,8 @@ ProcessUtility(Node *parsetree, ...@@ -171,8 +171,8 @@ ProcessUtility(Node *parsetree,
foreach (arg, args) { foreach (arg, args) {
relname = strVal(lfirst(arg)); relname = strVal(lfirst(arg));
if (IsSystemRelationName(relname)) if (IsSystemRelationName(relname))
elog(WARN, "class \"%-.*s\" is a system catalog", elog(WARN, "class \"%s\" is a system catalog",
NAMEDATALEN, relname); relname);
rel = heap_openr (relname); rel = heap_openr (relname);
if ( RelationIsValid (rel) ) if ( RelationIsValid (rel) )
{ {
...@@ -188,8 +188,8 @@ ProcessUtility(Node *parsetree, ...@@ -188,8 +188,8 @@ ProcessUtility(Node *parsetree,
} }
#ifndef NO_SECURITY #ifndef NO_SECURITY
if (!pg_ownercheck(userName, relname, RELNAME)) if (!pg_ownercheck(userName, relname, RELNAME))
elog(WARN, "you do not own class \"%-.*s\"", elog(WARN, "you do not own class \"%s\"",
NAMEDATALEN, relname); relname);
#endif #endif
} }
foreach (arg, args) { foreach (arg, args) {
...@@ -318,8 +318,8 @@ ProcessUtility(Node *parsetree, ...@@ -318,8 +318,8 @@ ProcessUtility(Node *parsetree,
foreach (i, stmt->relNames) { foreach (i, stmt->relNames) {
relname = strVal(lfirst(i)); relname = strVal(lfirst(i));
if (!pg_ownercheck(userName, relname, RELNAME)) if (!pg_ownercheck(userName, relname, RELNAME))
elog(WARN, "you do not own class \"%-.*s\"", elog(WARN, "you do not own class \"%s\"",
NAMEDATALEN, relname); relname);
} }
#endif #endif
foreach (i, stmt->relNames) { foreach (i, stmt->relNames) {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.4 1997/08/12 20:16:01 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.5 1997/08/18 20:53:41 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
* namein - converts "..." to internal representation * namein - converts "..." to internal representation
* *
* Note: * Note:
* Currently if strlen(s) < NAMEDATALEN, the extra chars are nulls * [Old] Currently if strlen(s) < NAMEDATALEN, the extra chars are nulls
* Now, always NULL terminated
*/ */
NameData *namein(char *s) NameData *namein(char *s)
{ {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.12 1997/08/12 22:54:41 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.13 1997/08/18 20:53:48 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -284,7 +284,7 @@ BuildDescInfoError(RelationBuildDescInfo buildinfo) ...@@ -284,7 +284,7 @@ BuildDescInfoError(RelationBuildDescInfo buildinfo)
sprintf(errBuf, "(relation id %d)", buildinfo.i.info_id); sprintf(errBuf, "(relation id %d)", buildinfo.i.info_id);
break; break;
case INFO_RELNAME: case INFO_RELNAME:
sprintf(errBuf, "(relation name %.*s)", NAMEDATALEN, buildinfo.i.info_name); sprintf(errBuf, "(relation name %s)", buildinfo.i.info_name);
break; break;
} }
...@@ -1282,8 +1282,8 @@ RelationForgetRelation (Oid rid) ...@@ -1282,8 +1282,8 @@ RelationForgetRelation (Oid rid)
prev = curr; prev = curr;
} }
if ( curr == NIL ) if ( curr == NIL )
elog (FATAL, "Local relation %.*s not found in list", elog (FATAL, "Local relation %s not found in list",
NAMEDATALEN, (RelationGetRelationName(relation))->data); (RelationGetRelationName(relation))->data);
if ( prev == NIL ) if ( prev == NIL )
newlyCreatedRelns = lnext (newlyCreatedRelns); newlyCreatedRelns = lnext (newlyCreatedRelns);
else else
......
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