1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

Second try at fixing join alias variables. Instead of attaching miscellaneous

lists to join RTEs, attach a list of Vars and COALESCE expressions that will
replace the join's alias variables during planning.  This simplifies
flatten_join_alias_vars while still making it easy to fix up varno references
when transforming the query tree.  Add regression test cases for interactions
of subqueries with outer joins.
This commit is contained in:
Tom Lane
2002-04-28 19:54:29 +00:00
parent c8996f9c6b
commit 6c59886942
21 changed files with 624 additions and 653 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: planmain.h,v 1.55 2002/03/12 00:52:03 tgl Exp $
* $Id: planmain.h,v 1.56 2002/04/28 19:54:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,7 +59,7 @@ extern void process_implied_equality(Query *root, Node *item1, Node *item2,
extern void set_plan_references(Query *root, Plan *plan);
extern List *join_references(List *clauses, Query *root,
List *outer_tlist, List *inner_tlist,
Index acceptable_rel, Index join_rti);
Index acceptable_rel);
extern void fix_opids(Node *node);
/*

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: var.h,v 1.18 2002/03/12 00:52:04 tgl Exp $
* $Id: var.h,v 1.19 2002/04/28 19:54:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -23,8 +23,6 @@ extern bool contain_var_reference(Node *node, int varno, int varattno,
extern bool contain_whole_tuple_var(Node *node, int varno, int levelsup);
extern bool contain_var_clause(Node *node);
extern List *pull_var_clause(Node *node, bool includeUpperVars);
extern Node *flatten_join_alias_vars(Node *node, Query *root, int expandRTI);
extern void build_join_alias_subvars(Query *root, Var *aliasvar,
Var **leftsubvar, Var **rightsubvar);
extern Node *flatten_join_alias_vars(Node *node, Query *root, bool force);
#endif /* VAR_H */