pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix issue with code manually adjusting a TupleTableSlot 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix issue with code manually adjusting a TupleTableSlot @ 2026-10-29 20:50 David Rowley <drowley@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: David Rowley @ 2026-10-29 20:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ 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(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix issue with code manually adjusting a TupleTableSlot @ 2026-10-29 20:50 David Rowley <drowley@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: David Rowley @ 2026-10-29 20:50 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-10-29 20:50 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-29 20:50 pgsql: Fix issue with code manually adjusting a TupleTableSlot David Rowley <drowley@postgresql.org> 2026-10-29 20:50 pgsql: Fix issue with code manually adjusting a TupleTableSlot David Rowley <drowley@postgresql.org>
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