git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: f6c1dec) | patch
Consider a clause to be outerjoin_delayed if it references the nullable side
2008年6月27日 20:54:37 +0000 (20:54 +0000)
2008年6月27日 20:54:37 +0000 (20:54 +0000)
commit dcc23347365d1958898445ffdcf34c09689b8d55
Consider a clause to be outerjoin_delayed if it references the nullable side
of any lower outer join, even if it also references the non-nullable side and
so could not get pushed below the outer join anyway. We need this in case
the clause is an OR clause: if it doesn't get marked outerjoin_delayed,
create_or_index_quals() could pull an indexable restriction for the nullable
side out of it, leading to wrong results as demonstrated by today's bug
report from toruvinn. (See added regression test case for an example.)

In principle this has been wrong for quite a while. In practice I don't
think any branch before 8.3 can really show the failure, because
create_or_index_quals() will only pull out indexable conditions, and before
8.3 those were always strict. So though we might have improperly generated
null-extended rows in the outer join, they'd get discarded from the result
anyway. The gating factor that makes the failure visible is that 8.3
considers "col IS NULL" to be indexable. Hence I'm not going to risk
back-patching further than 8.3.
src/backend/optimizer/plan/initsplan.c diff | blob | blame | history
src/test/regress/expected/join.out diff | blob | blame | history
src/test/regress/expected/join_1.out diff | blob | blame | history
src/test/regress/sql/join.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /