]> 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:04:02 +0000 (19:04 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 25 Sep 2010 23:04:02 +0000 (19:04 -0400)
commit7fc8db849106db91e1053ed25045eb4fa877f212
treeb15c1963595600e1b61ac70c63dc07b54210d777
parent3613d0893f526619471026b6b04bda70e31fe9e2
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