summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2007-10-04 20:45:17 +0000
committerTom Lane2007-10-04 20:45:17 +0000
commitd9e961d52737823b30549d5c130790d62a79731f (patch)
tree0e9aae2019168d1ce7add6d39ab0a0af80852f4b /src/include
parent45cd13c8ab05aef5a334bca8a2d1e9a1b9b8815e (diff)
Keep the planner from failing on "WHERE false AND something IN (SELECT ...)".
eval_const_expressions simplifies this to just "WHERE false", but we have already done pull_up_IN_clauses so the IN join will be done, or at least planned, anyway. The trouble case comes when the sub-SELECT is itself a join and we decide to implement the IN by unique-ifying the sub-SELECT outputs: with no remaining reference to the output Vars in WHERE, we won't have propagated the Vars up to the upper join point, leading to "variable not found in subplan target lists" error. Fix by adding an extra scan of in_info_list and forcing all Vars mentioned therein to be propagated up to the IN join point. Per bug report from Miroslav Sulc.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/optimizer/planmain.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/optimizer/planmain.h b/src/include/optimizer/planmain.h
index d288c4e3374..1b252a8f63d 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
*
- * $Id: planmain.h,v 1.75.4.1 2005/09/28 21:17:50 tgl Exp $
+ * $Id: planmain.h,v 1.75.4.2 2007/10/04 20:45:17 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -57,6 +57,7 @@ extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
*/
extern void add_base_rels_to_query(Query *root, Node *jtnode);
extern void build_base_rel_tlists(Query *root, List *final_tlist);
+extern void add_IN_vars_to_tlists(Query *root);
extern Relids distribute_quals_to_rels(Query *root, Node *jtnode,
bool below_outer_join);
extern void process_implied_equality(Query *root,