]> git.ipfire.org Git - thirdparty/postgresql.git/commit
amcheck: Use correct varlena size accessor in bt_normalize_tuple()
authorAlexander Korotkov <akorotkov@postgresql.org>
Sat, 13 Jun 2026 23:49:05 +0000 (02:49 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Sun, 14 Jun 2026 01:07:00 +0000 (04:07 +0300)
commit8abb8a1555f4051491eced0307adf218e0f9f34e
tree3fc15b34c1d98d8c914b8e528d56d15563971ef6
parentc0d44e00940672c55c56344f4f3b3ed16b555b01
amcheck: Use correct varlena size accessor in bt_normalize_tuple()

bt_normalize_tuple() uses VARSIZE() to get the size of varlena, even though
it's not yet known, that it has a 4-byte header.  Fix this by replacing a
accessor with a universal VARSIZE_ANY().

Backpatch to all supported versions.

Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/7ckc7oka4bvafkf5bwlqs6ygrhlsbhz25ppozfch7zbuxcx3rf%40e4pr4oqenalc
Author: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Backpatch-through: 14
contrib/amcheck/verify_nbtree.c