| 1 |
# |
| 2 |
# Bug#19424075 WRITE/SYNC REDO LOG BEFORE FLUSH THREAD CACHE TO BINLOG |
| 3 |
# |
| 4 |
# Verify that a transaction can not be recovered during server |
| 5 |
# recovery from a crash, which happened after flushing it to |
| 6 |
# InnoDB redo log and before flushing it to binary log. And |
| 7 |
# a transaction can be recovered during server recovery from |
| 8 |
# a crash, which happened after flushing it to binary log. |
| 9 |
# |
| 10 |
--source include/not_valgrind.inc |
| 11 |
--source include/have_log_bin.inc |
| 12 |
-- source include/have_debug.inc |
| 13 |
|
| 14 |
CREATE TABLE t1(c1 INT) ENGINE= InnoDB; |
| 15 |
|
| 16 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 17 |
--echo # Crash right after flushing InnoDB redo log |
| 18 |
SET SESSION DEBUG="+d,crash_after_flush_engine_log"; |
| 19 |
BEGIN; |
| 20 |
INSERT INTO t1 VALUES(1); |
| 21 |
# 2013 - CR_SERVER_LOST |
| 22 |
--error 2013 |
| 23 |
COMMIT; |
| 24 |
--source include/wait_until_disconnected.inc |
| 25 |
|
| 26 |
--enable_reconnect |
| 27 |
--echo # Restart the master server |
| 28 |
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 29 |
--source include/wait_until_connected_again.inc |
| 30 |
--disable_reconnect |
| 31 |
|
| 32 |
--echo # |
| 33 |
--echo # Verify that a transaction can not be recovered during server |
| 34 |
--echo # recovery from a crash, which happened after flushing it to |
| 35 |
--echo # InnoDB redo log and before flushing it to binary log. |
| 36 |
--echo # |
| 37 |
--let $assert_text= Table t1 must not contain 1 |
| 38 |
--let $assert_cond= [SELECT count(*) FROM t1 WHERE c1=1] = 0 |
| 39 |
--source include/assert.inc |
| 40 |
|
| 41 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 42 |
--echo # Crash right after flushing binary log |
| 43 |
SET SESSION DEBUG="+d,crash_after_flush_binlog"; |
| 44 |
BEGIN; |
| 45 |
INSERT INTO t1 VALUES(2); |
| 46 |
# 2013 - CR_SERVER_LOST |
| 47 |
--error 2013 |
| 48 |
COMMIT; |
| 49 |
--source include/wait_until_disconnected.inc |
| 50 |
|
| 51 |
--enable_reconnect |
| 52 |
--echo # Restart the master server |
| 53 |
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 54 |
--source include/wait_until_connected_again.inc |
| 55 |
--disable_reconnect |
| 56 |
|
| 57 |
--echo # |
| 58 |
--echo # Verify that a transaction can be recovered during server |
| 59 |
--echo # recovery from a crash, which happened after flushing it |
| 60 |
--echo # to binary log. |
| 61 |
--echo # |
| 62 |
--let $assert_text= Table t1 must contain 2 |
| 63 |
--let $assert_cond= [SELECT count(*) FROM t1 WHERE c1=2] = 1 |
| 64 |
--source include/assert.inc |
| 65 |
|
| 66 |
# Cleanup |
| 67 |
DROP TABLE t1; |