agora inbox for pgsql-committers@postgresql.org
help / color / mirror / Atom feedFrom: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix incorrect Result node flattening logic
Date: Fri, 31 Jul 2026 01:16:19 +0000
Message-ID: <E1wpbrH-000000011RA-0RK5@gemulon.postgresql.org> (raw)
Fix incorrect Result node flattening logic
This fixes some incorrect flattening of nested Result nodes during
create_plan that was introduced by f2bae51df. That commit failed to
maintain the logic that checks for subplans and gating quals from the
nested Result node before flattening, and that could result in the nested
gating qual and subplan being lost, which could produce incorrect results.
Bug: #19579
Reported-by: Viktor Leis <leis@in.tum.de>
Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/19579-e6296b6c9fc0591c@postgresql.org
Backpatch-through: 19
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/d6eac691747499645f21398c9e305d7a671e0229
Modified Files
--------------
src/backend/optimizer/plan/createplan.c | 21 +++++++++++----------
src/test/regress/expected/join.out | 11 +++++++++++
src/test/regress/sql/join.sql | 8 ++++++++
3 files changed, 30 insertions(+), 10 deletions(-)
view thread (2+ messages) latest in thread
Message-ID: <E1wpbrH-000000011RA-0RK5@gemulon.postgresql.org>
Permalink: ../E1wpbrH-000000011RA-0RK5@gemulon.postgresql.org/
Also on: postgresql.org/message-id/E1wpbrH-000000011RA-0RK5@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 using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix incorrect Result node flattening logic
In-Reply-To: <E1wpbrH-000000011RA-0RK5@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox