]> granicus.if.org Git - postgresql/commit
Fix another join removal bug: the check on PlaceHolderVars was wrong.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Sep 2010 23:03:50 +0000 (19:03 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Sep 2010 23:03:50 +0000 (19:03 -0400)
commitc8c03d72e10cab3cc47975b2689c8efbb4eade94
tree8b2d457b2976c808393db387e99d5e61aa5606a1
parent635de8365f0299cfa2db24c56abcfccb65d020f0
Fix another join removal bug: the check on PlaceHolderVars was wrong.

The previous coding would decide that join removal was unsafe upon finding
a PlaceHolderVar that needed to be evaluated at the inner rel and then used
above the join.  However, this fails to cover the case of PlaceHolderVars
that refer to both the inner rel and some other rels.  Per bug report from
Andrus.
src/backend/optimizer/plan/analyzejoins.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql