]> granicus.if.org Git - postgresql/commit
Remove an unsafe Assert, and explain join_clause_is_movable_into() better.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 Jul 2015 17:20:40 +0000 (13:20 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 28 Jul 2015 17:20:40 +0000 (13:20 -0400)
commitd6a8a29ac2bca06d4466e449f13d0cc52220714b
tree99149921b79e08d9136e5e7b7e3d5832c9519f73
parent0abe9554fc793f05d5c7f18b4b6682d9f1154922
Remove an unsafe Assert, and explain join_clause_is_movable_into() better.

join_clause_is_movable_into() is approximate, in the sense that it might
sometimes return "false" when actually it would be valid to push the given
join clause down to the specified level.  This is okay ... but there was
an Assert in get_joinrel_parampathinfo() that's only safe if the answers
are always exact.  Comment out the Assert, and add a bunch of commentary
to clarify what's going on.

Per fuzz testing by Andreas Seltenreich.  The added regression test is
a pretty silly query, but it's based on his crasher example.

Back-patch to 9.2 where the faulty logic was introduced.
src/backend/optimizer/util/relnode.c
src/backend/optimizer/util/restrictinfo.c
src/test/regress/expected/join.out
src/test/regress/sql/join.sql