pgsql: amcheck: Use correct varlena size accessor in bt_normalize_tuple

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: amcheck: Use correct varlena size accessor in bt_normalize_tuple
Date: 2026-06-14 01:14:23
Message-ID: E1wYZQd-000DU5-1V@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)anarazel(dot)de>
Discussion: https://postgr.es/m/7ckc7oka4bvafkf5bwlqs6ygrhlsbhz25ppozfch7zbuxcx3rf%40e4pr4oqenalc
Author: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>
Reviewed-by: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/af09b18cbadbb91ffe617b9ee5549de420e9b21a

Modified Files
--------------
contrib/amcheck/verify_nbtree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Etsuro Fujita 2026-06-14 07:04:49 pgsql: Fix oversight in commit aa1f93a33.
Previous Message Alexander Korotkov 2026-06-14 01:14:21 pgsql: amcheck: Use correct varlena size accessor in bt_normalize_tuple