]> granicus.if.org Git - postgresql/commit
Fix longstanding bug that would sometimes let the planner generate a bad plan
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 25 Oct 2005 20:30:45 +0000 (20:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 25 Oct 2005 20:30:45 +0000 (20:30 +0000)
commitfcd978c57d4ee50bd530490eee1191a155d60205
tree92a3f40e7e90746627cb4f1e81c7da440b3aaa2c
parent01145f963fe4979714ffb1517903e42d56e56592
Fix longstanding bug that would sometimes let the planner generate a bad plan
for an outer join; symptom is bogus error "RIGHT JOIN is only supported with
merge-joinable join conditions".  Problem was that select_mergejoin_clauses
did its tests in the wrong order.  We need to force left join not right join
for a merge join when there are non-mergeable join clauses; but the test for
this only accounted for mergejoinability of the clause operator, and not
whether the left and right Vars were of the proper relations.  Per report
from Jean-Pierre Pelletier.
src/backend/optimizer/path/joinpath.c