| 1 |
CREATE TABLE t (a INT); |
| 2 |
# 0. Disable checkpoints and page cleaners. |
| 3 |
SET GLOBAL innodb_checkpoint_disabled = 1; |
| 4 |
SET GLOBAL innodb_purge_stop_now = 1; |
| 5 |
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; |
| 6 |
# 1. Commit transaction. |
| 7 |
BEGIN; |
| 8 |
INSERT INTO t(a) VALUES(1); |
| 9 |
COMMIT; |
| 10 |
# 2. Crash trying to execute next transaction. |
| 11 |
BEGIN; |
| 12 |
INSERT INTO t(a) VALUES(2); |
| 13 |
SET GLOBAL innodb_log_flush_now = ON; |
| 14 |
# Kill the server |
| 15 |
# 3. Start MySQL after crash but pause trx_recovery_rollback thread to simulate delay. |
| 16 |
# restart: --innodb-fast-shutdown=1 --debug=d,pause_rollback_on_recovery |
| 17 |
# 4. Stop MySQL using fast shutdown. |
| 18 |
# Verifying that recovery found transactions which need rollback |
| 19 |
Pattern "MY-013023" found |
| 20 |
# 5. Restart MySQL and restore defaults (clean up for next tests). |
| 21 |
# restart |
| 22 |
DROP TABLE t; |