2012-11-19 14:58:51 +05:30
|
|
|
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");
|
|
|
|
# Create and populate the table to be corrupted
|
|
|
|
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');
|
2013-02-20 18:25:18 +05:30
|
|
|
# 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
|
2012-11-19 14:58:51 +05:30
|
|
|
# Corrupt the table
|
|
|
|
Munged a string.
|
|
|
|
Munged a string.
|
2013-02-20 18:25:18 +05:30
|
|
|
# Write file to make mysql-test-run.pl start up the server again
|
2013-05-07 13:05:09 +02:00
|
|
|
SET DEBUG_DBUG = '+d,innodb_page_corruption_retries';
|
2013-02-20 18:25:18 +05:30
|
|
|
# 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
|
2012-11-19 14:58:51 +05:30
|
|
|
SELECT * FROM t1;
|
|
|
|
ERROR HY000: Lost connection to MySQL server during query
|
2013-02-20 18:25:18 +05:30
|
|
|
# Restore the original t1.ibd
|
|
|
|
# Write file to make mysql-test-run.pl start up the server again
|
2012-11-19 14:58:51 +05:30
|
|
|
# Cleanup
|
|
|
|
DROP TABLE t1;
|