1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-31 10:30:33 +03:00

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

This commit is contained in:
Bruce Momjian
1997-08-18 20:53:48 +00:00
parent 022903f22e
commit b99c63cfc0
26 changed files with 207 additions and 220 deletions

View File

@@ -8,7 +8,7 @@
*
*
* 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,
AttributeTupleForm attributeP,
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,
NAMEDATALEN, /* attname is a char16 */
attributeP->attname.data,
value != NULL ? " = \"" : "",
value != NULL ? value : "",

View File

@@ -7,7 +7,7 @@
*
*
* 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
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -347,18 +347,11 @@ BuildDescForRelation(List *schema, char *relname)
arry = entry->typename->arrayBounds;
attisset = entry->typename->setof;
if (arry != NIL) {
char buf[20];
strNcpy(typename, entry->typename->name,NAMEDATALEN-1);
if (arry != NIL)
attdim = length(arry);
/* 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);
else
attdim = 0;
}
if (! TupleDescInitEntry(desc, attnum, attname,
typename, attdim, attisset)) {
@@ -372,8 +365,8 @@ BuildDescForRelation(List *schema, char *relname)
if (!strcmp(typename, relname)) {
TupleDescMakeSelfReference(desc, attnum, relname);
} else
elog(WARN, "DefineRelation: no such type %.*s",
NAMEDATALEN, typename);
elog(WARN, "DefineRelation: no such type %s",
typename);
}
/*

View File

@@ -7,7 +7,7 @@
*
*
* 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
* Postgres hash pages look like ordinary relation pages. The opaque
@@ -195,8 +195,8 @@ _hash_getbuf(Relation rel, BlockNumber blkno, int access)
_hash_setpagelock(rel, blkno, access);
break;
default:
elog(WARN, "_hash_getbuf: invalid access (%d) on new blk: %.*s",
access, NAMEDATALEN, RelationGetRelationName(rel));
elog(WARN, "_hash_getbuf: invalid access (%d) on new blk: %s",
access, RelationGetRelationName(rel));
break;
}
buf = ReadBuffer(rel, blkno);
@@ -221,8 +221,8 @@ _hash_relbuf(Relation rel, Buffer buf, int access)
_hash_unsetpagelock(rel, blkno, access);
break;
default:
elog(WARN, "_hash_relbuf: invalid access (%d) on blk %x: %.*s",
access, blkno, NAMEDATALEN, RelationGetRelationName(rel));
elog(WARN, "_hash_relbuf: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
}
ReleaseBuffer(buf);
@@ -279,8 +279,8 @@ _hash_chgbufaccess(Relation rel,
_hash_relbuf(rel, *bufp, from_access);
break;
default:
elog(WARN, "_hash_chgbufaccess: invalid access (%d) on blk %x: %.*s",
from_access, blkno, NAMEDATALEN, RelationGetRelationName(rel));
elog(WARN, "_hash_chgbufaccess: invalid access (%d) on blk %x: %s",
from_access, blkno, RelationGetRelationName(rel));
break;
}
*bufp = _hash_getbuf(rel, blkno, to_access);
@@ -325,8 +325,8 @@ _hash_setpagelock(Relation rel,
RelationSetSingleRLockPage(rel, &iptr);
break;
default:
elog(WARN, "_hash_setpagelock: invalid access (%d) on blk %x: %.*s",
access, blkno, NAMEDATALEN, RelationGetRelationName(rel));
elog(WARN, "_hash_setpagelock: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
break;
}
}
@@ -350,8 +350,8 @@ _hash_unsetpagelock(Relation rel,
RelationUnsetSingleRLockPage(rel, &iptr);
break;
default:
elog(WARN, "_hash_unsetpagelock: invalid access (%d) on blk %x: %.*s",
access, blkno, NAMEDATALEN, RelationGetRelationName(rel));
elog(WARN, "_hash_unsetpagelock: invalid access (%d) on blk %x: %s",
access, blkno, RelationGetRelationName(rel));
break;
}
}