| 1 |
# |
| 2 |
# WL#5493 & WL#5440 |
| 3 |
# |
| 4 |
# Test case4 verifies if the halfly binlogged non-transaction |
| 5 |
# statement will be trimmed from the crashed binlog file |
| 6 |
# and the data will not be recovered successfully after |
| 7 |
# the master restarts when setting DEBUG POINT in the |
| 8 |
# middle of binlog to make the master crash. |
| 9 |
# |
| 10 |
|
| 11 |
-- source include/not_group_replication_plugin.inc |
| 12 |
--source include/not_rpl_gtid_only.inc |
| 13 |
-- source include/not_have_privilege_checks_user.inc |
| 14 |
# Don't test this under valgrind, memory leaks will occur |
| 15 |
-- source include/not_valgrind.inc |
| 16 |
-- source include/have_debug.inc |
| 17 |
-- source include/force_myisam_default.inc |
| 18 |
-- source include/have_myisam.inc |
| 19 |
-- source include/have_binlog_format_row.inc |
| 20 |
-- source include/not_crashrep.inc |
| 21 |
-- source include/master-slave.inc |
| 22 |
|
| 23 |
|
| 24 |
# Reset master |
| 25 |
connection slave; |
| 26 |
--source include/stop_slave.inc |
| 27 |
|
| 28 |
connection master; |
| 29 |
RESET MASTER; |
| 30 |
|
| 31 |
#connection slave; |
| 32 |
#--source include/start_slave.inc |
| 33 |
|
| 34 |
connection master; |
| 35 |
call mtr.add_suppression("Attempting backtrace"); |
| 36 |
call mtr.add_suppression("allocated tablespace *., old maximum was 0"); |
| 37 |
call mtr.add_suppression("Error in Log_event::read_log_event()"); |
| 38 |
call mtr.add_suppression("Buffered warning: Performance schema disabled"); |
| 39 |
|
| 40 |
-- let $old_debug = `select @@global.debug` |
| 41 |
-- echo # Test case4: Set DEBUG POINT in the middle of binlog to |
| 42 |
-- echo # make the master crash for non-transaction. |
| 43 |
-- let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1) |
| 44 |
-- let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) |
| 45 |
CREATE TABLE t2(a LONGBLOB) ENGINE=MYISAM; |
| 46 |
# Write file to make mysql-test-run.pl expect crash and restart |
| 47 |
-- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 48 |
--disable_query_log |
| 49 |
eval SET SESSION debug=CONCAT(IF(LENGTH('$old_debug') > 0, "$old_debug:", ""), "d,debug,info,enter,return,half_binlogged_transaction"); |
| 50 |
--enable_query_log |
| 51 |
-- error 2013 |
| 52 |
INSERT INTO t2 (a) VALUES (REPEAT('a',16384)); |
| 53 |
|
| 54 |
-- source include/wait_until_disconnected.inc |
| 55 |
-- enable_reconnect |
| 56 |
-- echo # Restart the master server |
| 57 |
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 58 |
-- source include/wait_until_connected_again.inc |
| 59 |
-- disable_reconnect |
| 60 |
|
| 61 |
-- echo # Test the halfly binlogged non-transaction statement will be trimmed |
| 62 |
-- echo # from the crashed binlog file |
| 63 |
-- source include/show_binlog_events.inc |
| 64 |
|
| 65 |
-- echo # Test the data will not be recovered successfully |
| 66 |
-- echo # after the master restart. |
| 67 |
SELECT COUNT(*) FROM t2; |
| 68 |
|
| 69 |
DROP TABLE t2; |
| 70 |
connection slave; |
| 71 |
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION= 0; |