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: Remove over-optimistic Assert.
Date: Tue, 31 Jan 2023 16:58:10 +0000
Message-ID: <E1pMtxR-000uZR-Dg@gemulon.postgresql.org> (raw)

Remove over-optimistic Assert.

In commit 2489d76c4, I'd thought it'd be safe to assert that a
PlaceHolderVar appearing in a scan-level expression has empty
nullingrels.  However this is not so, as when we determine that a
join relation is certainly empty we'll put its targetlist into a
Result-with-constant-false-qual node, and nothing is done to adjust
the nullingrels of the Vars or PHVs therein.  (Arguably, a Result
used in this way isn't really a scan-level node, but it certainly
isn't an upper node either ...)

It's not clear this is worth any close analysis, so let's just
take out the faulty Assert.

Per report from Robins Tharakan.  I added a test case based on
his example, just in case somebody tries to tighten this up.

Discussion: https://postgr.es/m/CAEP4nAz7Enq3+DEthGG7j27DpuwSRZnW0Nh6jtNh75yErQ_nbA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/eae0e20deffb0a73f7cb0e94746f94a1347e71b1

Modified Files
--------------
src/backend/optimizer/plan/setrefs.c |  2 +-
src/test/regress/expected/join.out   | 14 ++++++++++++++
src/test/regress/sql/join.sql        |  8 ++++++++
3 files changed, 23 insertions(+), 1 deletion(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1pMtxR-000uZR-Dg@gemulon.postgresql.org>
Permalink:  ../E1pMtxR-000uZR-Dg@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pMtxR-000uZR-Dg@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: Remove over-optimistic Assert.
  In-Reply-To: <E1pMtxR-000uZR-Dg@gemulon.postgresql.org>
  References: <E1pMtxR-000uZR-Dg@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