| From: | David Rowley <drowley(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix issue with code manually adjusting a TupleTableSlot |
| Date: | 2026-10-29 20:50:15 |
| Message-ID: | E1xMX4h-00000001IxV-1weF@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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(at)gmail(dot)com>
Author: David Rowley <dgrowleyml(at)gmail(dot)com>
Reviewed-by: Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>
Discussion: https://postgr.es/m/19783-070e4bf0c73c1076@postgresql.org
Backpatch-through: 19
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/93ec486803b703fbc7fe7ea332da92e30cefc381
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(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2026-10-29 20:50:41 | pgsql: Fix issue with code manually adjusting a TupleTableSlot |
| Previous Message | Robert Haas | 2026-10-29 16:56:09 | pgsql: pg_stash_advice: Don't forget unsaved changes after a failed wri |