From dda3c6611ef5fd4a619b8284e56a990b9e0fefe7 Mon Sep 17 00:00:00 2001
From: Jianghua Yang <yjhjstz@gmail.com>
Date: Mon, 23 Mar 2026 18:29:54 -0700
Subject: [PATCH v1] Fix copy-paste error in test_ginpostinglist second itemptr
 check

The check for a mismatch on the second decoded item pointer was an
exact copy of the first item pointer check, comparing orig_itemptrs[0]
with decoded_itemptrs[0] instead of orig_itemptrs[1] with
decoded_itemptrs[1].  The error message also reported (0, 1) as the
expected value instead of (blk, off).  As a result, any decoding error
in the second item pointer (where the varbyte delta encoding is
exercised) would go undetected.

Author: Jianghua Yang <yjhjstz@gmail.com>
---
 .../modules/test_ginpostinglist/test_ginpostinglist.c     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test/modules/test_ginpostinglist/test_ginpostinglist.c b/src/test/modules/test_ginpostinglist/test_ginpostinglist.c
index 83cf3469886..6d84364f5c5 100644
--- a/src/test/modules/test_ginpostinglist/test_ginpostinglist.c
+++ b/src/test/modules/test_ginpostinglist/test_ginpostinglist.c
@@ -72,12 +72,12 @@ test_itemptr_pair(BlockNumber blk, OffsetNumber off, int maxsize)
 			 ItemPointerGetOffsetNumber(&decoded_itemptrs[0]));
 
 	if (ndecoded == 2 &&
-		!ItemPointerEquals(&orig_itemptrs[0], &decoded_itemptrs[0]))
+		!ItemPointerEquals(&orig_itemptrs[1], &decoded_itemptrs[1]))
 	{
 		elog(ERROR, "mismatch on second itemptr: (%u, %d) vs (%u, %d)",
-			 0, 1,
-			 ItemPointerGetBlockNumber(&decoded_itemptrs[0]),
-			 ItemPointerGetOffsetNumber(&decoded_itemptrs[0]));
+			 blk, off,
+			 ItemPointerGetBlockNumber(&decoded_itemptrs[1]),
+			 ItemPointerGetOffsetNumber(&decoded_itemptrs[1]));
 	}
 }
 
-- 
2.50.1 (Apple Git-155)

