summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2004-01-18 00:50:03 +0000
committerTom Lane2004-01-18 00:50:03 +0000
commit6bdfde9a7790ff350f176ae6506c4a061d7f02f4 (patch)
tree3e21cbecd3f3fb358306f90894e314c32b0cd320 /src/include
parentde816a03c4f94b95f4107766b275b3ea4e2ddf80 (diff)
When testing whether a sub-plan can do projection, use a general-purpose
check instead of hardwiring assumptions that only certain plan node types can appear at the places where we are testing. This was always a pretty fragile assumption, and it turns out to be broken in 7.4 for certain cases involving IN-subselect tests that need type coercion. Also, modify code that builds finished Plan tree so that node types that don't do projection always copy their input node's targetlist, rather than having the tlist passed in from the caller. The old method makes it too easy to write broken code that thinks it can modify the tlist when it cannot.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/optimizer/planmain.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index 9f1ed28aa18..f9368d525c4 100644
--- a/src/include/optimizer/planmain.h
+++ b/src/include/optimizer/planmain.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/optimizer/planmain.h,v 1.76 2003/11/29 22:41:07 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/optimizer/planmain.h,v 1.77 2004/01/18 00:50:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,8 +30,8 @@ extern Plan *create_plan(Query *root, Path *best_path);
extern SubqueryScan *make_subqueryscan(List *qptlist, List *qpqual,
Index scanrelid, Plan *subplan);
extern Append *make_append(List *appendplans, bool isTarget, List *tlist);
-extern Sort *make_sort_from_sortclauses(Query *root, List *tlist,
- Plan *lefttree, List *sortcls);
+extern Sort *make_sort_from_sortclauses(Query *root, List *sortcls,
+ Plan *lefttree);
extern Sort *make_sort_from_groupcols(Query *root, List *groupcls,
AttrNumber *grpColIdx, Plan *lefttree);
extern Agg *make_agg(Query *root, List *tlist, List *qual,
@@ -43,14 +43,14 @@ extern Group *make_group(Query *root, List *tlist,
int numGroupCols, AttrNumber *grpColIdx,
double numGroups,
Plan *lefttree);
-extern Material *make_material(List *tlist, Plan *lefttree);
+extern Material *make_material(Plan *lefttree);
extern Plan *materialize_finished_plan(Plan *subplan);
-extern Unique *make_unique(List *tlist, Plan *lefttree, List *distinctList);
-extern Limit *make_limit(List *tlist, Plan *lefttree,
- Node *limitOffset, Node *limitCount);
-extern SetOp *make_setop(SetOpCmd cmd, List *tlist, Plan *lefttree,
+extern Unique *make_unique(Plan *lefttree, List *distinctList);
+extern Limit *make_limit(Plan *lefttree, Node *limitOffset, Node *limitCount);
+extern SetOp *make_setop(SetOpCmd cmd, Plan *lefttree,
List *distinctList, AttrNumber flagColIdx);
extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
+extern bool is_projection_capable_plan(Plan *plan);
/*
* prototypes for plan/initsplan.c