From 0d34736e4c1629ba12fd4c848984308f2037998f Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 15 Sep 2026 16:44:42 +0900 Subject: [PATCH] amcheck: Fix thinko with check of TOASTed attribute A chunk_id type that does not match with one of the expected values (oid or oid8) was missing a "return" clause. This caused the code to report two corruptions instead of one. Oversight in 6e58d6356fcb. Discussion: https://postgr.es/m/aqju1K96ex28yz2X@paquier.xyz --- contrib/amcheck/verify_heapam.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c index 8c57adc5d54..27648894831 100644 --- a/contrib/amcheck/verify_heapam.c +++ b/contrib/amcheck/verify_heapam.c @@ -1884,7 +1884,7 @@ check_toasted_attribute(HeapCheckContext *ctx, ToastedAttribute *ta) int32 max_chunk_size; Oid8 toast_valueid; Oid toast_typid; - vartag_external expected_tag = VARTAG_ONDISK_OID; + vartag_external expected_tag; toast_valueid = ta->va_valueid; extsize = VARATT_EXTINFO_GET_EXTSIZE(ta->va_extinfo); @@ -1904,6 +1904,7 @@ check_toasted_attribute(HeapCheckContext *ctx, ToastedAttribute *ta) report_toast_corruption(ctx, ta, psprintf("toast value " OID8_FORMAT " stored in toast table whose chunk_id has unexpected type %u", toast_valueid, toast_typid)); + return; } if (ta->tag != expected_tag)