]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans
authorDavid Rowley <drowley@postgresql.org>
Wed, 1 May 2024 01:23:05 +0000 (13:23 +1200)
committerDavid Rowley <drowley@postgresql.org>
Wed, 1 May 2024 01:23:05 +0000 (13:23 +1200)
commit0a34bcd0c23e7f67daad7b026320a12c52d797ac
tree2dc7670da55694fb9ebee35f225486c220861bdd
parent1ee22d1e87b3c442928abe9535d6b2bf8460fc67
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
src/backend/executor/nodeIndexonlyscan.c
src/include/catalog/pg_opclass.dat
src/include/nodes/execnodes.h
src/test/regress/expected/index_including.out
src/test/regress/sql/index_including.sql