mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
New NameStr macro to convert Name to Str. No need for var.data anymore.
Fewer calls to nameout. Better use of RelationGetRelationName.
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.99 1999/11/01 05:09:17 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.100 1999/11/07 23:08:05 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -559,7 +559,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
|
||||
|
||||
if (resultRelationDesc->rd_rel->relkind == RELKIND_SEQUENCE)
|
||||
elog(ERROR, "You can't change sequence relation %s",
|
||||
resultRelationDesc->rd_rel->relname.data);
|
||||
RelationGetRelationName(resultRelationDesc));
|
||||
|
||||
resultRelationInfo = makeNode(RelationInfo);
|
||||
resultRelationInfo->ri_RangeTableIndex = resultRelationIndex;
|
||||
@ -1501,7 +1501,7 @@ ExecRelCheck(Relation rel, HeapTuple tuple, EState *estate)
|
||||
slot->ttc_tupleDescriptor = rel->rd_att;
|
||||
slot->ttc_buffer = InvalidBuffer;
|
||||
slot->ttc_whichplan = -1;
|
||||
rte->relname = nameout(&(rel->rd_rel->relname));
|
||||
rte->relname = RelationGetRelationName(rel);
|
||||
rte->refname = rte->relname;
|
||||
rte->relid = RelationGetRelid(rel);
|
||||
/* inh, inFromCl, inJoinSet, skipAcl won't be used, leave them zero */
|
||||
@ -1538,7 +1538,6 @@ ExecRelCheck(Relation rel, HeapTuple tuple, EState *estate)
|
||||
}
|
||||
|
||||
pfree(slot);
|
||||
pfree(rte->relname);
|
||||
pfree(rte);
|
||||
pfree(rtlist);
|
||||
pfree(econtext);
|
||||
@ -1561,7 +1560,7 @@ ExecConstraints(char *caller, Relation rel, HeapTuple tuple, EState *estate)
|
||||
{
|
||||
if (rel->rd_att->attrs[attrChk - 1]->attnotnull && heap_attisnull(tuple, attrChk))
|
||||
elog(ERROR, "%s: Fail to add null value in not null attribute %s",
|
||||
caller, rel->rd_att->attrs[attrChk - 1]->attname.data);
|
||||
caller, NameStr(rel->rd_att->attrs[attrChk - 1]->attname));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.30 1999/09/24 00:24:23 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.31 1999/11/07 23:08:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -913,7 +913,7 @@ ExecTypeFromTL(List *targetList)
|
||||
(Oid) restype,
|
||||
resdom->resno,
|
||||
resdom->reslen,
|
||||
resdom->resname->data,
|
||||
NameStr(*resdom->resname),
|
||||
get_typbyval(restype),
|
||||
get_typalign(restype));
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.49 1999/09/18 19:06:48 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.50 1999/11/07 23:08:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -546,9 +546,9 @@ ExecSetTypeInfo(int index,
|
||||
att->attrelid = 0; /* dummy value */
|
||||
|
||||
if (attName != (char *) NULL)
|
||||
StrNCpy(att->attname.data, attName, NAMEDATALEN);
|
||||
StrNCpy(NameStr(att->attname), attName, NAMEDATALEN);
|
||||
else
|
||||
MemSet(att->attname.data, 0, NAMEDATALEN);
|
||||
MemSet(NameStr(att->attname), 0, NAMEDATALEN);
|
||||
|
||||
att->atttypid = typeID;
|
||||
att->attdefrel = 0; /* dummy value */
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.24 1999/07/17 20:16:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeUnique.c,v 1.25 1999/11/07 23:08:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -314,7 +314,7 @@ ExecInitUnique(Unique *node, EState *estate, Plan *parent)
|
||||
* the parser should have ensured that uniqueAttr is a legal
|
||||
* attribute name
|
||||
*/
|
||||
while (strcmp((tupDesc->attrs[i]->attname).data, uniqueAttr) != 0)
|
||||
while (strcmp(NameStr(tupDesc->attrs[i]->attname), uniqueAttr) != 0)
|
||||
i++;
|
||||
node->uniqueAttrNum = i + 1; /* attribute numbers start from 1 */
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
* spi.c
|
||||
* Server Programming Interface
|
||||
*
|
||||
* $Id: spi.c,v 1.40 1999/07/15 22:39:11 momjian Exp $
|
||||
* $Id: spi.c,v 1.41 1999/11/07 23:08:06 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -369,7 +369,7 @@ SPI_fnumber(TupleDesc tupdesc, char *fname)
|
||||
|
||||
for (res = 0; res < tupdesc->natts; res++)
|
||||
{
|
||||
if (strcasecmp(tupdesc->attrs[res]->attname.data, fname) == 0)
|
||||
if (strcasecmp(NameStr(tupdesc->attrs[res]->attname), fname) == 0)
|
||||
return res + 1;
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ SPI_fname(TupleDesc tupdesc, int fnumber)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return nameout(&(tupdesc->attrs[fnumber - 1]->attname));
|
||||
return pstrdup(NameStr(tupdesc->attrs[fnumber - 1]->attname));
|
||||
}
|
||||
|
||||
char *
|
||||
@ -459,7 +459,7 @@ SPI_gettype(TupleDesc tupdesc, int fnumber)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return pstrdup(((Form_pg_type) GETSTRUCT(typeTuple))->typname.data);
|
||||
return pstrdup(NameStr(((Form_pg_type) GETSTRUCT(typeTuple))->typname));
|
||||
}
|
||||
|
||||
Oid
|
||||
@ -479,7 +479,7 @@ SPI_gettypeid(TupleDesc tupdesc, int fnumber)
|
||||
char *
|
||||
SPI_getrelname(Relation rel)
|
||||
{
|
||||
return pstrdup(rel->rd_rel->relname.data);
|
||||
return pstrdup(RelationGetRelationName(rel));
|
||||
}
|
||||
|
||||
void *
|
||||
|
Reference in New Issue
Block a user