[PATCH] Align verify_heapam.c error message offset with test expectations - Mailing list pgsql-hackers

From zengman
Subject [PATCH] Align verify_heapam.c error message offset with test expectations
Date
Msg-id tencent_6D253E6F517F8F85796F0D9D@qq.com
Whole thread Raw
Responses Re: [PATCH] Align verify_heapam.c error message offset with test expectations
Re: [PATCH] Align verify_heapam.c error message offset with test expectations
List pgsql-hackers
Hi all,

I think there might be an issue with the error messages in contrib/amcheck/verify_heapam.c.
The test comment in src/bin/pg_amcheck/t/004_verify_heapam.pl (line 715) clearly states:
```
# Tuple at offset 43 is the successor of this one
```
This indicates that for the test case at offnum == 36, the error message should report "offset 43" (the successor), not
"offset36" (the current tuple).
 
However, when I updated the test expectation from \d+ wildcard to the exact value offset 43, the test fails. 
This makes me wonder whether the current code in verify_heapam.c (lines 777, 793, 799) should be using nextoffnum
insteadof ctx.offnum.
 
This would also be consistent with similar error messages at lines 746-747 and 753-754, which use nextoffnum when
referringto the produced tuple location.
 

--
Regards,
Man Zeng
www.openhalo.org
Attachment

pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Fix accidentally cast away qualifiers
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Newly created replication slot may be invalidated by checkpoint