Skip to content

Commit

Permalink
MDEV-20138 innodb.trx_id_future fails on 10.4+
Browse files Browse the repository at this point in the history
Adjust the test for full_crc32.
  • Loading branch information
dr-m committed Aug 14, 2019
1 parent 7772c7c commit c4feef5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 5 additions & 0 deletions mysql-test/suite/innodb/t/trx_id_future.combinations
@@ -0,0 +1,5 @@
[strict_crc32]
--innodb-checksum-algorithm=strict_crc32

[strict_full_crc32]
--innodb-checksum-algorithm=strict_full_crc32
16 changes: 13 additions & 3 deletions mysql-test/suite/innodb/t/trx_id_future.test
Expand Up @@ -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
Expand All @@ -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";
Expand Down

0 comments on commit c4feef5

Please sign in to comment.