Skip to content

Commit 7e3f3de

Browse files
committed
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.
1 parent 3a91dec commit 7e3f3de

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

mysql-test/suite/innodb/r/innodb-wl5522-debug.result

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
call mtr.add_suppression("InnoDB: Page for tablespace .* ");
2+
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
23
FLUSH TABLES;
34
SET GLOBAL innodb_file_per_table = 1;
45
SELECT @@innodb_file_per_table;
@@ -912,7 +913,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
912913
restore: t1 .ibd and .cfg files
913914
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
914915
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
915-
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
916+
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
916917
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure";
917918
DROP TABLE test_wl5522.t1;
918919
unlink: t1.ibd

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
7474
my $page_size = $ENV{INNODB_PAGE_SIZE};
7575
my $page;
7676
open(FILE, "+<", $fname) or die;
77-
sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $file\n";
78-
sysseek(FILE, 0, 0)||die "Unable to seek $file\n";
77+
sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n";
78+
sysseek(FILE, 0, 0)||die "Unable to seek $fname\n";
7979
die unless syswrite(FILE, chr(0) x $page_size, $page_size) == $page_size;
8080
close FILE;
8181

8282
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}ibdata1")||die "cannot open ibdata1\n";
8383
sysseek(FILE, 6 * $page_size - 190, 0)||die "Unable to seek ibdata1\n";
8484
sysread(FILE, $_, 12) == 12||die "Unable to read TRX_SYS\n";
85-
my($magic,$d1,$d2)=unpack "NNN";
85+
my($magic,$d1,$d2)=unpack "NNN", $_;
8686
die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64;
8787
sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n";
8888
# Find the page in the doublewrite buffer
@@ -92,7 +92,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
9292
next unless $_ eq $page;
9393
sysseek(FILE, $d * $page_size, 0)||die "Unable to seek ibdata1\n";
9494
# Write buggy MariaDB 10.1.x FSP_SPACE_FLAGS to the doublewrite buffer
95-
my($flags) = unpack "x[54]N";
95+
my($flags) = unpack "x[54]N", $_;
9696
my $badflags = ($flags & 0x3f);
9797
my $compression_level=6;
9898
$badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
@@ -102,7 +102,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
102102
# Replace the innodb_checksum_algorithm=none checksum
103103
substr ($_, 0, 4) = pack("N", 0xdeadbeef);
104104
substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
105-
syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
105+
syswrite(FILE, $_, $page_size)==$page_size||die;
106106
close(FILE);
107107
exit 0;
108108
}

mysql-test/suite/innodb/t/innodb-wl5522-debug.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
-- source include/have_innodb.inc
1717

1818
call mtr.add_suppression("InnoDB: Page for tablespace .* ");
19+
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
1920
FLUSH TABLES;
2021

2122
let MYSQLD_DATADIR =`SELECT @@datadir`;

0 commit comments

Comments
 (0)