diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-07-31 19:53:50 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-07-31 19:53:50 +0000 |
commit | 1be62b532b441aaff4b2d9c9dc028b96c4b7a8c7 (patch) | |
tree | f2a9ab9ff05c13f759bf58945166027c0f4bc030 /src/backend/optimizer/util/relnode.c | |
parent | 5bd7b8342685a7d6d5ab134b321f8e4ccfdeaa16 (diff) | |
download | postgresql-1be62b532b441aaff4b2d9c9dc028b96c4b7a8c7.tar.gz postgresql-1be62b532b441aaff4b2d9c9dc028b96c4b7a8c7.zip |
Fix a bug in the original implementation of redundant-join-clause removal:
clauses in which one side or the other references both sides of the join
cannot be removed as redundant, because that expression won't have been
constrained below the join. Per report from Sergey Burladyan.
Diffstat (limited to 'src/backend/optimizer/util/relnode.c')
-rw-r--r-- | src/backend/optimizer/util/relnode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c index 4d5bffdb7b1..2a3a14ae6b1 100644 --- a/src/backend/optimizer/util/relnode.c +++ b/src/backend/optimizer/util/relnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/relnode.c,v 1.83 2006/10/04 00:29:55 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/relnode.c,v 1.83.2.1 2007/07/31 19:53:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -515,6 +515,8 @@ build_joinrel_restrictlist(PlannerInfo *root, * omit the redundant clause from the result list. */ result = remove_redundant_join_clauses(root, rlist, + outer_rel->relids, + inner_rel->relids, IS_OUTER_JOIN(jointype)); list_free(rlist); |