Fix a bug in the original implementation of redundant-join-clause removal:
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/indxpath.c | modified | +4 −2 |
| src/backend/optimizer/plan/createplan.c | modified | +3 −1 |
| src/backend/optimizer/util/relnode.c | modified | +5 −2 |
| src/backend/optimizer/util/restrictinfo.c | modified | +45 −12 |
| src/include/optimizer/restrictinfo.h | modified | +5 −1 |
| src/test/regress/expected/join.out | modified | +16 −0 |
| src/test/regress/sql/join.sql | modified | +16 −0 |