Skip to content

Commit 7702d7a

Browse files
committed
target list fixes.
1 parent 1d00134 commit 7702d7a

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

src/backend/optimizer/plan/planner.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.28 1998/07/19 05:49:14 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.29 1998/07/20 21:18:32 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -446,7 +446,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
446446

447447
if (typeTypeRelid(typ) == InvalidOid)
448448
{
449-
if (exec_tlist_length(tlist) > 1)
449+
if (ExecTargetListLength(tlist) > 1)
450450
elog(ERROR, "function declared to return %s returns multiple values in final retrieve", typeTypeName(typ));
451451

452452
resnode = (Resdom *) ((TargetEntry *) lfirst(tlist))->resdom;
@@ -464,7 +464,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
464464
* is 'retrieve (x = func2())', where func2 has the same return type
465465
* as the function that's calling it.
466466
*/
467-
if (exec_tlist_length(tlist) == 1)
467+
if (ExecTargetListLength(tlist) == 1)
468468
{
469469
resnode = (Resdom *) ((TargetEntry *) lfirst(tlist))->resdom;
470470
if (resnode->restype == rettype)
@@ -485,7 +485,7 @@ pg_checkretval(Oid rettype, QueryTreeList *queryTreeList)
485485
relid = reln->rd_id;
486486
relnatts = reln->rd_rel->relnatts;
487487

488-
if (exec_tlist_length(tlist) != relnatts)
488+
if (ExecTargetListLength(tlist) != relnatts)
489489
elog(ERROR, "function declared to return type %s does not retrieve (%s.*)", typeTypeName(typ), typeTypeName(typ));
490490

491491
/* expect attributes 1 .. n in order */

src/backend/optimizer/util/tlist.c

+1-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.15 1998/07/20 19:53:48 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.16 1998/07/20 21:18:34 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -589,23 +589,3 @@ AddGroupAttrToTlist(List *tlist, List *grpCl)
589589
}
590590

591591
#endif
592-
593-
/* was ExecTargetListLength() in execQual.c,
594-
moved here to reduce dependencies on the executor module */
595-
int
596-
exec_tlist_length(List *targetlist)
597-
{
598-
int len;
599-
List *tl;
600-
TargetEntry *curTle;
601-
602-
len = 0;
603-
foreach(tl, targetlist)
604-
{
605-
curTle = lfirst(tl);
606-
607-
if (curTle->resdom != NULL)
608-
len++;
609-
}
610-
return len;
611-
}

src/include/optimizer/tlist.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: tlist.h,v 1.11 1998/07/20 20:48:54 momjian Exp $
9+
* $Id: tlist.h,v 1.12 1998/07/20 21:18:35 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -17,7 +17,6 @@
1717
#include "nodes/parsenodes.h"
1818
#include "nodes/relation.h"
1919

20-
extern int exec_tlist_length(List *targelist);
2120
extern TargetEntry *tlistentry_member(Var *var, List *targetlist);
2221
extern Expr *matching_tlvar(Var *var, List *targetlist);
2322
extern void add_tl_element(RelOptInfo *rel, Var *var);
@@ -30,8 +29,7 @@ extern TargetEntry *match_varid(Var *test_var, List *tlist);
3029
extern List *new_unsorted_tlist(List *targetlist);
3130
extern List *copy_vars(List *target, List *source);
3231
extern List *flatten_tlist(List *tlist);
33-
extern List *
34-
flatten_tlist_vars(List *full_tlist,
32+
extern List *flatten_tlist_vars(List *full_tlist,
3533
List *flat_tlist);
3634

3735
#endif /* TLIST_H */

0 commit comments

Comments
 (0)