MDEV-20138 innodb.trx_id_future fails on 10.4+
Adjust the test for full_crc32.
This commit is contained in:
parent
7772c7cd94
commit
c4feef50cf
5
mysql-test/suite/innodb/t/trx_id_future.combinations
Normal file
5
mysql-test/suite/innodb/t/trx_id_future.combinations
Normal file
@ -0,0 +1,5 @@
|
||||
[strict_crc32]
|
||||
--innodb-checksum-algorithm=strict_crc32
|
||||
|
||||
[strict_full_crc32]
|
||||
--innodb-checksum-algorithm=strict_full_crc32
|
@ -30,6 +30,8 @@ binmode FILE;
|
||||
|
||||
my $ps= $ENV{PAGE_SIZE};
|
||||
my $page;
|
||||
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
|
||||
my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
|
||||
sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
|
||||
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
|
||||
#In this case the first record should be at offset 135
|
||||
@ -38,10 +40,18 @@ die unless unpack("n", substr($page, 99, 2)) == 135;
|
||||
substr($page,135+6,6) = "\xff" x 6;
|
||||
|
||||
my $polynomial = 0x82f63b78; # CRC-32C
|
||||
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
|
||||
if ($full_crc32)
|
||||
{
|
||||
my $ck = mycrc32(substr($page, 0, $ps - 4), 0, $polynomial);
|
||||
substr($page, $ps - 4, 4) = pack("N", $ck);
|
||||
}
|
||||
else
|
||||
{
|
||||
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
|
||||
mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
|
||||
substr($page,0,4)=$ck;
|
||||
substr($page,$ps-8,4)=$ck;
|
||||
substr($page,0,4)=$ck;
|
||||
substr($page,$ps-8,4)=$ck;
|
||||
}
|
||||
sysseek(FILE, 3*$ps, 0) || die "Unable to rewind $file\n";
|
||||
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
|
||||
close(FILE) || die "Unable to close $file";
|
||||
|
Loading…
x
Reference in New Issue
Block a user