Skip to content

Commit c4feef5

Browse files
committed
MDEV-20138 innodb.trx_id_future fails on 10.4+
Adjust the test for full_crc32.
1 parent 7772c7c commit c4feef5

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[strict_crc32]
2+
--innodb-checksum-algorithm=strict_crc32
3+
4+
[strict_full_crc32]
5+
--innodb-checksum-algorithm=strict_full_crc32

mysql-test/suite/innodb/t/trx_id_future.test

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ binmode FILE;
3030

3131
my $ps= $ENV{PAGE_SIZE};
3232
my $page;
33+
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
34+
my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
3335
sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
3436
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
3537
#In this case the first record should be at offset 135
@@ -38,10 +40,18 @@ die unless unpack("n", substr($page, 99, 2)) == 135;
3840
substr($page,135+6,6) = "\xff" x 6;
3941

4042
my $polynomial = 0x82f63b78; # CRC-32C
41-
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
43+
if ($full_crc32)
44+
{
45+
my $ck = mycrc32(substr($page, 0, $ps - 4), 0, $polynomial);
46+
substr($page, $ps - 4, 4) = pack("N", $ck);
47+
}
48+
else
49+
{
50+
my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
4251
mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
43-
substr($page,0,4)=$ck;
44-
substr($page,$ps-8,4)=$ck;
52+
substr($page,0,4)=$ck;
53+
substr($page,$ps-8,4)=$ck;
54+
}
4555
sysseek(FILE, 3*$ps, 0) || die "Unable to rewind $file\n";
4656
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
4757
close(FILE) || die "Unable to close $file";

0 commit comments

Comments
 (0)