pgsql: Fix some planner issues with degenerate outer join clauses.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix some planner issues with degenerate outer join clauses.
Date: 2015-08-02 00:58:04
Message-ID: E1ZLhbI-0006WA-T4@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix some planner issues with degenerate outer join clauses.

An outer join clause that didn't actually reference the RHS (perhaps only
after constant-folding) could confuse the join order enforcement logic,
leading to wrong query results. Also, nested occurrences of such things
could trigger an Assertion that on reflection seems incorrect.

Per fuzz testing by Andreas Seltenreich. The practical use of such cases
seems thin enough that it's not too surprising we've not heard field
reports about it.

This has been broken for a long time, so back-patch to all active branches.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7968238eb17ed5f2f1123271549b7921fa1d3aba

Modified Files
--------------
src/backend/optimizer/path/joinrels.c | 26 ++++---
src/backend/optimizer/plan/initsplan.c | 18 ++++-
src/test/regress/expected/join.out | 129 ++++++++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 50 +++++++++++++
4 files changed, 211 insertions(+), 12 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-08-02 13:13:19 Re: pgsql: Replace our hacked version of ax_pthread.m4 with latest upstream
Previous Message Tom Lane 2015-08-01 18:32:07 pgsql: Teach predtest.c that "foo" implies "foo IS NOT NULL".