summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan/initsplan.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1997-02-20 02:54:09 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1997-02-20 02:54:09 +0000
commit4de2f24895315e90db17d15c3e07f87df265e301 (patch)
treec22eb069e72537dde7f0f3cf848d7e44344fe2fa /src/backend/optimizer/plan/initsplan.c
parent6eb05251854b15b073357b3e30ebcf4f182af1a8 (diff)
Fix for queries with 3 or more relations participating in
one clause.
Diffstat (limited to 'src/backend/optimizer/plan/initsplan.c')
-rw-r--r--src/backend/optimizer/plan/initsplan.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index fcafc872718..f7ec544eee2 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.2 1996/10/31 10:59:13 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/initsplan.c,v 1.3 1997/02/20 02:53:26 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -250,10 +250,19 @@ add_join_clause_info_to_rels(Query *root, CInfo *clauseinfo, List *join_relids)
List *join_relid;
foreach (join_relid, join_relids) {
- JInfo *joininfo =
+ JInfo *joininfo;
+ List *other_rels = NIL;
+ List *rel;
+
+ foreach (rel, join_relids)
+ {
+ if ( (int)lfirst(rel) != (int)lfirst(join_relid) )
+ other_rels = lappendi (other_rels, lfirst(rel));
+ }
+
+ joininfo =
find_joininfo_node(get_base_rel(root, lfirsti(join_relid)),
- intLispRemove((int)lfirst(join_relid),
- join_relids));
+ other_rels);
joininfo->jinfoclauseinfo =
lcons(clauseinfo, joininfo->jinfoclauseinfo);