| From: | David Rowley <drowley(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Fix new tuple deforming code so it can support cstrings again |
| Date: | 2026-03-20 01:16:26 |
| Message-ID: | E1w3OTR-000ZXQ-0R@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Fix new tuple deforming code so it can support cstrings again
In c456e3911, I mistakenly thought that the deformer code would never
see cstrings and that I could use pg_assume() to have the compiler omit
producing code for attlen == -2 attributes. That saves bloating the
deforming code a bit with the extra check and strlen() call. While this
is ok to do for tuples from the heap, it's not ok to do for
MinimalTuples as those *can* contain cstrings and
tts_minimal_getsomeattrs() implements deforming by inlining the
(slightly misleadingly named) slot_deform_heap_tuple() code.
To fix, add a new parameter to the slot_deform_heap_tuple() and have the
callers define which code to inline. Because this new parameter is
passed as a const, the compiler can choose to emit or not emit the
cstring-related code based on the parameter's value.
Author: David Rowley <dgrowleyml(at)gmail(dot)com>
Reported-by: Tender Wang <tndrwang(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAHewXNmSK+gKziAt_WvQoMVWt3_LRVMmRYY9dAbMPMcpPV0QmA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/07d5bffe75d05b9c84803ea1ffaf5ce729f0e717
Modified Files
--------------
src/backend/executor/execTuples.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Amit Kapila | 2026-03-20 06:12:17 | pgsql: Add support for EXCEPT TABLE in ALTER PUBLICATION. |
| Previous Message | Jeff Davis | 2026-03-19 22:08:31 | pgsql: Fix dependency on FDW handler. |