Fix portability issues in pg_amcheck's 004_verify_heapam.pl.

Robert Haas <rhaas@postgresql.org>

Commit: 661125612706b1d0d5ed9f12d18908b08512a7eb
Author: Robert Haas <rhaas@postgresql.org>
Date: 2021-03-12T22:34:32Z
Releases: 14.0
Fix portability issues in pg_amcheck's 004_verify_heapam.pl.

Test #12 overwrote a 1-byte varlena header to make it look like the
initial byte of a 4-byte varlena header, but the results were
endian-dependent. Also, the byte "abc" that followed the overwritten
byte would be interpreted differently depending on endian-ness.
Overwrite 4 bytes instead, in an endian-aware manner.

Test #13 accidentally managed to depend on TOAST_MAX_CHUNK_SIZE,
which varies slightly depending on MAXIMUM_ALIGNOF. That's not
the point anyway, so make the regexp insensitive to the expected
number of chunks.

Mark Dilger

Discussion: http://postgr.es/m/A80D68F6-E38F-482D-9522-E2FB6AAFE8A1@enterprisedb.com

Files

PathChange+/−
src/bin/pg_amcheck/t/004_verify_heapam.pl modified +42 −30

Discussion