summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-16 09:15:56 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-16 11:23:12 +0200
commit7e3f3deb41a875778a540718abd8f90278e4cb67 (patch)
tree4c9a8285980cde757df7739f58fa84d82ea48a2c
parent3a91dec1243773627d08965e7e258571a7844deb (diff)
downloadmariadb-git-7e3f3deb41a875778a540718abd8f90278e4cb67.tar.gz
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.
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug.result3
-rw-r--r--mysql-test/suite/innodb/t/doublewrite.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug.test1
3 files changed, 8 insertions, 6 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
index ee8bd22c58f..031f382401f 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
@@ -1,4 +1,5 @@
call mtr.add_suppression("InnoDB: Page for tablespace .* ");
+call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
FLUSH TABLES;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@ -912,7 +913,7 @@ ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
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";
DROP TABLE test_wl5522.t1;
unlink: t1.ibd
diff --git a/mysql-test/suite/innodb/t/doublewrite.test b/mysql-test/suite/innodb/t/doublewrite.test
index 245b4e1a676..6e0a4a70200 100644
--- a/mysql-test/suite/innodb/t/doublewrite.test
+++ b/mysql-test/suite/innodb/t/doublewrite.test
@@ -74,15 +74,15 @@ my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
my $page_size = $ENV{INNODB_PAGE_SIZE};
my $page;
open(FILE, "+<", $fname) or die;
-sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $file\n";
-sysseek(FILE, 0, 0)||die "Unable to seek $file\n";
+sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n";
+sysseek(FILE, 0, 0)||die "Unable to seek $fname\n";
die unless syswrite(FILE, chr(0) x $page_size, $page_size) == $page_size;
close FILE;
open(FILE, "+<", "$ENV{MYSQLD_DATADIR}ibdata1")||die "cannot open 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";
-my($magic,$d1,$d2)=unpack "NNN";
+my($magic,$d1,$d2)=unpack "NNN", $_;
die "magic=$magic, $d1, $d2\n" unless $magic == 536853855 && $d2 >= $d1 + 64;
sysseek(FILE, $d1 * $page_size, 0)||die "Unable to seek ibdata1\n";
# Find the page in the doublewrite buffer
@@ -92,7 +92,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
next unless $_ eq $page;
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
- my($flags) = unpack "x[54]N";
+ my($flags) = unpack "x[54]N", $_;
my $badflags = ($flags & 0x3f);
my $compression_level=6;
$badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
@@ -102,7 +102,7 @@ for (my $d = $d1; $d < $d2 + 64; $d++)
# Replace the innodb_checksum_algorithm=none checksum
substr ($_, 0, 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);
exit 0;
}
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
index e8a037ab2f1..6c94f408ae9 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
@@ -16,6 +16,7 @@
-- source include/have_innodb.inc
call mtr.add_suppression("InnoDB: Page for tablespace .* ");
+call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
FLUSH TABLES;
let MYSQLD_DATADIR =`SELECT @@datadir`;