pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix thinko in qual distribution.
Date: Sat, 04 Feb 2023 22:40:43 +0000
Message-ID: <E1pORD8-001cUE-HR@gemulon.postgresql.org> (raw)

Fix thinko in qual distribution.

deconstruct_distribute tweaks the outer join scope (ojscope)
it passes to distribute_qual_to_rels when considering an outer
join qual that's above potentially-commutable outer joins.
However, if the current join is *not* potentially commutable,
we shouldn't do that.  The argument that distribute_qual_to_rels
will not do something wrong with the bogus ojscope falls flat
if we don't pass it non-null postponed_oj_qual_list.  Moreover,
there's no need to play games in this case since we aren't going
to commute anything.

Per SQLSmith testing by Robins Tharakan.

Discussion: https://postgr.es/m/CAEP4nAw74k4b-=93gmfCNX3MOY3y4uPxqbk_MnCVEpdsqHJVsg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9f452feeeb830534dc2ce743a2a14b109128326d

Modified Files
--------------
src/backend/optimizer/plan/initsplan.c | 29 ++++++++++++++---------------
src/test/regress/expected/join.out     | 18 ++++++++++++++++++
src/test/regress/sql/join.sql          | 10 ++++++++++
3 files changed, 42 insertions(+), 15 deletions(-)



Message-ID: <E1pORD8-001cUE-HR@gemulon.postgresql.org>
Permalink:  ../E1pORD8-001cUE-HR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pORD8-001cUE-HR@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix thinko in qual distribution.
  In-Reply-To: <E1pORD8-001cUE-HR@gemulon.postgresql.org>
  References: <E1pORD8-001cUE-HR@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox