mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Now that names are null terminated, no need to do all that NAMEDATALEN stuff.
This commit is contained in:
@@ -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 : "",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user