| 1 |
# Create and populate the table to be corrupted |
| 2 |
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) COMPRESSION="none", |
| 3 |
ROW_FORMAT=COMPACT ENGINE=InnoDB; |
| 4 |
INSERT INTO t1 (b) VALUES ('corrupt me'); |
| 5 |
INSERT INTO t1 (b) VALUES ('corrupt me'); |
| 6 |
# Backup the t1.ibd before corrupting |
| 7 |
# Corrupt the table |
| 8 |
Munged a string. |
| 9 |
Munged a string. |
| 10 |
# restart |
| 11 |
SET DEBUG = '+d,innodb_page_corruption_retries'; |
| 12 |
# Write file to make mysql-test-run.pl expect the "crash", but don't |
| 13 |
# start it until it's told to |
| 14 |
# The below SELECT query will crash the server because some pages |
| 15 |
# on the disk are corrupted |
| 16 |
SELECT * FROM t1; |
| 17 |
ERROR HY000: Lost connection to MySQL server during query |
| 18 |
# Restore the original t1.ibd |
| 19 |
# restart |
| 20 |
# Cleanup |
| 21 |
DROP TABLE t1; |