aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-03-22 17:14:21 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-03-22 17:14:21 -0400
commitc75a623304bc361b4456f916d455ea175ffd8055 (patch)
tree935c617b8d39c5cde3994cd4812036d3d01f1a53
parentb48af6d174bb39bd688d52795aef2b9c10dd6e8c (diff)
downloadpostgresql-c75a623304bc361b4456f916d455ea175ffd8055.tar.gz
postgresql-c75a623304bc361b4456f916d455ea175ffd8055.zip
Fix new test case to work on (some?) big-endian architectures.
Use of pack("L") gets around the basic endian problem, but it doesn't deal with the fact that the order of the bitfields within the struct may differ. This patch fixes it to work with gcc on NetBSD/macppc, but I wonder whether that will be enough --- in principle, there could be four different combinations of bitpatterns needed here. Discussion: https://postgr.es/m/1650745.1679513221@sss.pgh.pa.us
-rw-r--r--src/bin/pg_amcheck/t/004_verify_heapam.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_amcheck/t/004_verify_heapam.pl b/src/bin/pg_amcheck/t/004_verify_heapam.pl
index 92898c2a63d..cc4aa4af875 100644
--- a/src/bin/pg_amcheck/t/004_verify_heapam.pl
+++ b/src/bin/pg_amcheck/t/004_verify_heapam.pl
@@ -630,7 +630,7 @@ for (my $tupidx = 0; $tupidx < $ROWCOUNT; $tupidx++)
die "offnum $offnum should be a redirect" if defined $tup;
sysseek($file, 92, 0) or BAIL_OUT("sysseek failed: $!");
syswrite($file,
- pack("L", $ENDIANNESS eq 'little' ? 0x00010011 : 0x11000100))
+ pack("L", $ENDIANNESS eq 'little' ? 0x00010011 : 0x00230000))
or BAIL_OUT("syswrite failed: $!");
push @expected,
qr/${header}redirected line pointer points to another redirected line pointer at offset \d+/;
@@ -647,7 +647,7 @@ for (my $tupidx = 0; $tupidx < $ROWCOUNT; $tupidx++)
# rewrite line pointer with lp.off = 25, lp_flags = 2, lp_len = 0
sysseek($file, 108, 0) or BAIL_OUT("sysseek failed: $!");
syswrite($file,
- pack("L", $ENDIANNESS eq 'little' ? 0x00010019 : 0x19000100))
+ pack("L", $ENDIANNESS eq 'little' ? 0x00010019 : 0x00330000))
or BAIL_OUT("syswrite failed: $!");
push @expected,
qr/${header}redirect line pointer points to offset \d+, but offset \d+ also points there/;