Commit 7e3f3deb authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-11623 follow-up: Adjust tests.

innodb.doublewrite: Similar to what was done to innodb.101_compatibility,
add an explicit $_ parameter to the Perl unpack function.
Also, fix some diagnostic messages in the Perl code.

innodb.innodb-wl5522-debug: Adjust for the changed error codes and
messages on fault injection.
parent 3a91dec1
call mtr.add_suppression("InnoDB: Page for tablespace .* "); call mtr.add_suppression("InnoDB: Page for tablespace .* ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
FLUSH TABLES; FLUSH TABLES;
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table; SELECT @@innodb_file_per_table;
...@@ -912,7 +913,7 @@ ERROR HY000: Tablespace has been discarded for table 't1' ...@@ -912,7 +913,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
......
...@@ -74,15 +74,15 @@ my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd"; ...@@ -74,15 +74,15 @@ my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
my $page_size = $ENV{INNODB_PAGE_SIZE}; my $page_size = $ENV{INNODB_PAGE_SIZE};
my $page; my $page;
open(FILE, "+<", $fname) or die; open(FILE, "+<", $fname) or die;
sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $file\n"; sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n";
sysseek(FILE, 0, 0)||die "Unable to seek $file\n"; sysseek(FILE, 0, 0)||die "Unable to seek $fname\n";
die unless syswrite(FILE, chr(0) x $page_size, $page_size) == $page_size; die unless syswrite(FILE, chr(0) x $page_size, $page_size) == $page_size;
close FILE; close FILE;
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}ibdata1")||die "cannot open ibdata1\n"; open(FILE, "+<", "$ENV{MYSQLD_DATADIR}ibdata1")||die "cannot open ibdata1\n";
sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n"; sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n";
sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n"; sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n";
my($magic,$d1,$d2)=unpack "NNN"; my($magic,$d1,$d2)=unpack "NNN", $_;
die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64; die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64;
sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n"; sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n";
# Find the page in the doublewrite buffer # Find the page in the doublewrite buffer
...@@ -92,7 +92,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++) ...@@ -92,7 +92,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
next unless $_ eq $page; next unless $_ eq $page;
sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n"; sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n";
# Write buggy MariaDB 10.1.x FSP_SPACE_FLAGS to the doublewrite buffer # Write buggy MariaDB 10.1.x FSP_SPACE_FLAGS to the doublewrite buffer
my($flags) = unpack "x[54]N"; my($flags) = unpack "x[54]N", $_;
my $badflags = ($flags & 0x3f); my $badflags = ($flags & 0x3f);
my $compression_level=6; my $compression_level=6;
$badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16); $badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
...@@ -102,7 +102,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++) ...@@ -102,7 +102,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
# Replace the innodb_checksum_algorithm=none checksum # Replace the innodb_checksum_algorithm=none checksum
substr ($_, 0, 4) = pack("N", 0xdeadbeef); substr ($_, 0, 4) = pack("N", 0xdeadbeef);
substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef); substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n"; syswrite(FILE, $_, $page_size)==$page_size||die;
close(FILE); close(FILE);
exit 0; exit 0;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
-- source include/have_innodb.inc -- source include/have_innodb.inc
call mtr.add_suppression("InnoDB: Page for tablespace .* "); call mtr.add_suppression("InnoDB: Page for tablespace .* ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
FLUSH TABLES; FLUSH TABLES;
let MYSQLD_DATADIR =`SELECT @@datadir`; let MYSQLD_DATADIR =`SELECT @@datadir`;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment