Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans
David Rowley <drowley@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/nodeIndexonlyscan.c | modified | +88 −7 |
| src/include/catalog/pg_opclass.dat | modified | +5 −2 |
| src/include/nodes/execnodes.h | modified | +4 −0 |
| src/test/regress/expected/index_including.out | modified | +25 −0 |
| src/test/regress/sql/index_including.sql | modified | +19 −0 |
Discussion
- BUG #17855: Uninitialised memory used when the name type value processed in binary mode of Memoize 19 messages · 2023-03-20 → 2024-05-01