diff options
author | David Rowley <drowley@postgresql.org> | 2024-05-01 13:21:21 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2024-05-01 13:21:21 +1200 |
commit | a63224be49b86fccbf1bf1809d516626bce7ba11 (patch) | |
tree | ee80c74ffa3772fd108c67f719c8f20a2b2ca907 /src/include/nodes/execnodes.h | |
parent | 7562a9bd7100702ce7878a17f4aaac1df08a8e09 (diff) |
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans
As an optimization, we store "name" columns as cstrings in btree
indexes.
Here we modify it so that Index Only Scans convert these cstrings back
to names with NAMEDATALEN bytes rather than storing the cstring in the
tuple slot, as was happening previously.
Bug: #17855
Reported-by: Alexander Lakhin
Reviewed-by: Alexander Lakhin, Tom Lane
Discussion: https://postgr.es/m/17855-5f523e0f9769a566@postgresql.org
Backpatch-through: 12, all supported versions
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index d927ac44a82..8bc421e7c05 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -1690,6 +1690,8 @@ typedef struct IndexScanState * TableSlot slot for holding tuples fetched from the table * VMBuffer buffer in use for visibility map testing, if any * PscanLen size of parallel index-only scan descriptor + * NameCStringAttNums attnums of name typed columns to pad to NAMEDATALEN + * NameCStringCount number of elements in the NameCStringAttNums array * ---------------- */ typedef struct IndexOnlyScanState @@ -1709,6 +1711,8 @@ typedef struct IndexOnlyScanState TupleTableSlot *ioss_TableSlot; Buffer ioss_VMBuffer; Size ioss_PscanLen; + AttrNumber *ioss_NameCStringAttNums; + int ioss_NameCStringCount; } IndexOnlyScanState; /* ---------------- |