pgsql: Remove an unsafe Assert, and explain join_clause_is_movable_into

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove an unsafe Assert, and explain join_clause_is_movable_into
Date: 2015-07-28 17:21:28
Message-ID: E1ZK8ZE-0002Kv-50@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/95f4e59c3286671656aff7db45b322f14a7bb8cc

Modified Files
--------------
src/backend/optimizer/util/relnode.c | 9 ++++++
src/backend/optimizer/util/restrictinfo.c | 39 ++++++++++++++++++-----
src/test/regress/expected/join.out | 48 +++++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 26 ++++++++++++++++
4 files changed, 115 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2015-07-28 18:55:16 pgsql: Centralize decision-making about where to get a backend's PGPROC
Previous Message Andrew Dunstan 2015-07-28 17:19:30 pgsql: Improve logging of TAP tests.