From 5c2cbdfd907892c3f1e6a4f1a2ae6a13e7d4fa76 Mon Sep 17 00:00:00 2001
From: Man Zeng <zengman@halodbtech.com>
Date: Wed, 21 Jan 2026 22:17:44 +0800
Subject: [PATCH 2/2] fix: update offset variable in corruption report messages

---
 contrib/amcheck/verify_heapam.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c
index 30c2f583173..fa2451d6f1d 100644
--- a/contrib/amcheck/verify_heapam.c
+++ b/contrib/amcheck/verify_heapam.c
@@ -774,7 +774,7 @@ verify_heapam(PG_FUNCTION_ARGS)
 				report_corruption(&ctx,
 								  psprintf("tuple with in-progress xmin %u was updated to produce a tuple at offset %d with committed xmin %u",
 										   curr_xmin,
-										   ctx.offnum,
+										   nextoffnum,
 										   next_xmin));
 			}
 
@@ -790,13 +790,13 @@ verify_heapam(PG_FUNCTION_ARGS)
 					report_corruption(&ctx,
 									  psprintf("tuple with aborted xmin %u was updated to produce a tuple at offset %d with in-progress xmin %u",
 											   curr_xmin,
-											   ctx.offnum,
+											   nextoffnum,
 											   next_xmin));
 				else if (xmin_commit_status[nextoffnum] == XID_COMMITTED)
 					report_corruption(&ctx,
 									  psprintf("tuple with aborted xmin %u was updated to produce a tuple at offset %d with committed xmin %u",
 											   curr_xmin,
-											   ctx.offnum,
+											   nextoffnum,
 											   next_xmin));
 			}
 		}
-- 
2.45.2

