pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: holger.reise@vitagroup.ag
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18284: Filter in left lateral join not respected
Date: Thu, 11 Jan 2024 11:01:39 -0500
Message-ID: <74950.1704988899@sss.pgh.pa.us> (raw)
In-Reply-To: <18284-47505a20c23647f8@postgresql.org>
References: <18284-47505a20c23647f8@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> The following script returns two rows with `666`, whereas `null` is to be
> expected:

> WITH r1 AS (VALUES(null)),
> r2 AS (VALUES(null), (null))
> SELECT ljl.val_filtered
> FROM r1
> LEFT JOIN(
> 	SELECT j666.val FROM r2
> 	JOIN (SELECT 666 AS val) as j666 ON true
> )AS lj_r2 ON true
> LEFT JOIN LATERAL(
> 	SELECT lj_r2.val AS val_filtered
> 	WHERE false
> ) AS ljl ON true;

Hmph ... this has been broken for a good long while.  Bisecting
shows it gave the right answer before

4be058fe9ec5e630239b656af21fc083371f30ed is the first bad commit
commit 4be058fe9ec5e630239b656af21fc083371f30ed
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date:   Mon Jan 28 17:54:10 2019 -0500

    In the planner, replace an empty FROM clause with a dummy RTE.

so I'm betting that missed a condition about when it is safe to
flatten RTE_RESULT RTEs.  Will look, thanks for the report!

			regards, tom lane





view thread (5+ messages)  latest in thread

Message-ID: <74950.1704988899@sss.pgh.pa.us>
Permalink:  ../74950.1704988899@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/74950.1704988899@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, holger.reise@vitagroup.ag, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18284: Filter in left lateral join not respected
  In-Reply-To: <74950.1704988899@sss.pgh.pa.us>

* 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