summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb')
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14147491.result19
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug12400341.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14147491.test52
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14676111-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14676111.test5
5 files changed, 69 insertions, 12 deletions
diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result
index 6279f85f676..faf922ca5f8 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -4,14 +4,25 @@ CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
INSERT INTO t1 (b) VALUES ('corrupt me');
-# Restart server to flush buffers
+# Write file to make mysql-test-run.pl expect the "crash", but don't
+# start it until it's told to
+# We give 30 seconds to do a clean shutdown because we do not want
+# to redo apply the pages of t1.ibd at the time of recovery.
+# We want SQL to initiate the first access to t1.ibd.
+# Wait until disconnected.
+# Backup the t1.ibd before corrupting
# Corrupt the table
Munged a string.
Munged a string.
-# Write file to make mysql-test-run.pl expect crash and restart
+# Write file to make mysql-test-run.pl start up the server again
+SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
+# Write file to make mysql-test-run.pl expect the "crash", but don't
+# start it until it's told to
+# The below SELECT query will crash the server because some pages
+# on the disk are corrupted
SELECT * FROM t1;
ERROR HY000: Lost connection to MySQL server during query
-# Turn on reconnect
-# Wait for server to fully start
+# Restore the original t1.ibd
+# Write file to make mysql-test-run.pl start up the server again
# Cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test
index 2ab1be81f6d..ab69e20c495 100644
--- a/mysql-test/suite/innodb/t/innodb_bug12400341.test
+++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test
@@ -7,6 +7,10 @@ if (`select count(*)=0 from information_schema.global_variables where variable_n
--skip Test requires InnoDB built with UNIV_DEBUG definition.
}
+# Don't test under valgrind, undo slots of the previous test might exist still
+# and cause unstable result.
+--source include/not_valgrind.inc
+
call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too");
--disable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test
index ee3519c53fc..050f7fbdd73 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -10,6 +10,8 @@ source include/not_crashrep.inc;
source include/not_embedded.inc;
# Require InnoDB
source include/have_innodb.inc;
+# Require Debug for SET DEBUG
+source include/have_debug.inc;
CALL mtr.add_suppression("InnoDB: Error: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts");
CALL mtr.add_suppression("InnoDB: Warning: database page corruption or a failed");
@@ -27,13 +29,26 @@ while ($i)
--enable_query_log
INSERT INTO t1 (b) VALUES ('corrupt me');
---echo # Restart server to flush buffers
-source include/restart_mysqld.inc;
-
---echo # Corrupt the table
let $MYSQLD_DATADIR=`select @@datadir`;
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
+--echo # start it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # We give 30 seconds to do a clean shutdown because we do not want
+--echo # to redo apply the pages of t1.ibd at the time of recovery.
+--echo # We want SQL to initiate the first access to t1.ibd.
+shutdown_server 30;
+
+--echo # Wait until disconnected.
+--source include/wait_until_disconnected.inc
+
+--echo # Backup the t1.ibd before corrupting
+--copy_file $t1_IBD $MYSQLD_DATADIR/test/t1.ibd.backup
+
+--echo # Corrupt the table
+
perl;
use strict;
use warnings;
@@ -59,17 +74,38 @@ while ($len = sysread IBD_FILE, $chunk, 1024)
close IBD_FILE;
EOF
---echo # Write file to make mysql-test-run.pl expect crash and restart
+--echo # Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
+--echo # Write file to make mysql-test-run.pl expect the "crash", but don't
+--echo # start it until it's told to
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+--echo # The below SELECT query will crash the server because some pages
+--echo # on the disk are corrupted
--error 2013
SELECT * FROM t1;
---echo # Turn on reconnect
---enable_reconnect
+# The below mtr command --remove_file fails randomly on windows with
+# error number 13 which is permission denied on nix systems. We sleep
+# 1 second hoping that any process holding lock on t1.ibd is released.
+SLEEP 1;
---echo # Wait for server to fully start
+--echo # Restore the original t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+--move_file $MYSQLD_DATADIR/test/t1.ibd.backup $MYSQLD_DATADIR/test/t1.ibd
+
+--echo # Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
--source include/wait_until_connected_again.inc
+# Note SET DEBUG = '-d,innodb_page_corruption_retries' is not required
+# because the session information is lost after server restart
+
--echo # Cleanup
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_bug14676111-master.opt b/mysql-test/suite/innodb/t/innodb_bug14676111-master.opt
new file mode 100644
index 00000000000..e16b9b0b895
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug14676111-master.opt
@@ -0,0 +1 @@
+--loose-innodb-purge-threads=0
diff --git a/mysql-test/suite/innodb/t/innodb_bug14676111.test b/mysql-test/suite/innodb/t/innodb_bug14676111.test
index fadd111fdc9..41862b8105e 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14676111.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14676111.test
@@ -3,6 +3,11 @@
-- source include/have_innodb.inc
-- source include/have_debug.inc
+# Note that this test needs to be able to manipulate how/when purge is done
+# using @@innodb_limit_optimistic_insert_debug. This does not work with
+# background purge threads, so we disabled them in the -master.opt (they are
+# off by default in normal 5.5 innodb but on by default in xtradb)
+
if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG'`)
{
--skip Test requires InnoDB built with UNIV_DEBUG definition.