From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix issue with code manually adjusting a TupleTableSlot
Date: Thu, 29 Oct 2026 20:50:41 +0000
Message-ID: <E1xMX57-00000001IyU-2za2@gemulon.postgresql.org> (raw)
Fix issue with code manually adjusting a TupleTableSlot
c456e3911 changed how tuple deforming populates the slot's tts_isnull
array. This is now done 8 columns at a time instead of 1 column at a
time. That code also now deforms the tuple's entire NULL bitmap on each
incremental deform, where previously only the tts_isnull elements for
newly deformed attributes got set. This caused problems for grouping
sets queries.
In prepare_projection_slot() when grouped_cols was non-empty, the code
would manually put "true" into the grouped column's tts_isnull element to
represent the NULL for grouping sets which don't include that column.
This was incompatible with the post-c456e3911 complete fresh of previously
deformed tts_isnull elements, as if any further attributes needed to be
deformed after the NULLs were manually placed, the deforming code would
overwrite those NULLs.
Here we fix this by changing the slot_getsomeattrs() call to always
deform everything we need for this tuple. That means there will be no
additional tuple deforms for this tuple.
Bug: #19783
Reported-by: Alperen Keles <alpkeles99@gmail.com>
Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Discussion: https://postgr.es/m/19783-070e4bf0c73c1076@postgresql.org
Backpatch-through: 19
Branch
------
REL_19_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/04e0891fe0b8790b3c414bb5782b69d6491ff20b
Modified Files
--------------
src/backend/executor/nodeAgg.c | 32 +++++++++++++++++++++++++++---
src/test/regress/expected/groupingsets.out | 14 +++++++++++++
src/test/regress/sql/groupingsets.sql | 9 +++++++++
3 files changed, 52 insertions(+), 3 deletions(-)
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: drowley@postgresql.org
Subject: Re: pgsql: Fix issue with code manually adjusting a TupleTableSlot
In-Reply-To: <E1xMX57-00000001IyU-2za2@gemulon.postgresql.org>
References: <E1xMX57-00000001IyU-2za2@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