summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/trx_id_future.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-14 11:58:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-14 11:58:22 +0300
commitc4feef50cfa4033e646636ed37e255d2b3593fbf (patch)
tree627568a4993861c26e941b5fb27382b0d5a4a489 /mysql-test/suite/innodb/t/trx_id_future.test
parent7772c7cd945cf674b212b82f4d156099c67344a2 (diff)
downloadmariadb-git-c4feef50cfa4033e646636ed37e255d2b3593fbf.tar.gz
MDEV-20138 innodb.trx_id_future fails on 10.4+
Adjust the test for full_crc32.
Diffstat (limited to 'mysql-test/suite/innodb/t/trx_id_future.test')
-rw-r--r--mysql-test/suite/innodb/t/trx_id_future.test16
1 files changed, 13 insertions, 3 deletions
diff --git a/mysql-test/suite/innodb/t/trx_id_future.test b/mysql-test/suite/innodb/t/trx_id_future.test
index 564d36f9cfa..b73678abc4c 100644
--- a/mysql-test/suite/innodb/t/trx_id_future.test
+++ b/mysql-test/suite/innodb/t/trx_id_future.test
@@ -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";