1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-07 19:06:32 +03:00

target list fixes.

This commit is contained in:
Bruce Momjian
1998-07-20 21:18:35 +00:00
parent 1d00134be4
commit 7702d7aa4b
3 changed files with 7 additions and 29 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.28 1998/07/19 05:49:14 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.29 1998/07/20 21:18:32 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -446,7 +446,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
if (typeTypeRelid(typ) == InvalidOid)
{
if (exec_tlist_length(tlist) > 1)
if (ExecTargetListLength(tlist) > 1)
elog(ERROR, "function declared to return %s returns multiple values in final retrieve", typeTypeName(typ));
resnode = (Resdom *) ((TargetEntry *) lfirst(tlist))->resdom;
@@ -464,7 +464,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
* is 'retrieve (x = func2())', where func2 has the same return type
* as the function that's calling it.
*/
if (exec_tlist_length(tlist) == 1)
if (ExecTargetListLength(tlist) == 1)
{
resnode = (Resdom *) ((TargetEntry *) lfirst(tlist))->resdom;
if (resnode->restype == rettype)
@@ -485,7 +485,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
relid = reln->rd_id;
relnatts = reln->rd_rel->relnatts;
if (exec_tlist_length(tlist) != relnatts)
if (ExecTargetListLength(tlist) != relnatts)
elog(ERROR, "function declared to return type %s does not retrieve (%s.*)", typeTypeName(typ), typeTypeName(typ));
/* expect attributes 1 .. n in order */

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.15 1998/07/20 19:53:48 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.16 1998/07/20 21:18:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -589,23 +589,3 @@ AddGroupAttrToTlist(List *tlist, List *grpCl)
}
#endif
/* was ExecTargetListLength() in execQual.c,
moved here to reduce dependencies on the executor module */
int
exec_tlist_length(List *targetlist)
{
int len;
List *tl;
TargetEntry *curTle;
len = 0;
foreach(tl, targetlist)
{
curTle = lfirst(tl);
if (curTle->resdom != NULL)
len++;
}
return len;
}