| 1 |
# |
| 2 |
# ==== Purpose ==== |
| 3 |
# |
| 4 |
# This test checks if the Exec_Master_Log_Pos and the Read_Master_Log_Pos match |
| 5 |
# after a statement with an error ignored by the slave. |
| 6 |
# |
| 7 |
# ==== Implementation ==== |
| 8 |
# |
| 9 |
# Assert if Exec_Master_Log_Pos is the same as Read_Master_Log_Pos after three |
| 10 |
# different scenarios using non-transactional tables: |
| 11 |
# 1) DDL |
| 12 |
# 2) DML with autocommit |
| 13 |
# 3) DML inside a transaction |
| 14 |
# |
| 15 |
# ==== References ==== |
| 16 |
# |
| 17 |
# BUG#22268777 BINLOGLESS SLAVE DOES NOT UPDATE EXEC_MASTER_LOG_POS |
| 18 |
# WITH REPLICA_SKIP_ERRORS |
| 19 |
|
| 20 |
--source include/master-slave.inc |
| 21 |
--source include/force_myisam_default.inc |
| 22 |
--source include/have_myisam.inc |
| 23 |
|
| 24 |
|
| 25 |
CREATE TABLE t1_nontrans (n INT NOT NULL PRIMARY KEY) ENGINE=MYISAM; |
| 26 |
--source include/sync_slave_sql_with_master.inc |
| 27 |
|
| 28 |
call mtr.add_suppression("You need to use --log-bin to make --binlog-format work."); |
| 29 |
|
| 30 |
CREATE TABLE t2_nontrans (a INT) ENGINE=MYISAM; |
| 31 |
INSERT INTO t1_nontrans VALUES (1); |
| 32 |
INSERT INTO t1_nontrans VALUES (2); |
| 33 |
|
| 34 |
--source include/rpl_connection_master.inc |
| 35 |
# error because table already exists in slave |
| 36 |
CREATE TABLE t2_nontrans (a INT); |
| 37 |
|
| 38 |
--let $ignore_gtids_on_sync= 1 |
| 39 |
--source include/sync_slave_sql_with_master.inc |
| 40 |
|
| 41 |
--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) |
| 42 |
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1) |
| 43 |
|
| 44 |
--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after CREATE TABLE |
| 45 |
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos |
| 46 |
--source include/assert.inc |
| 47 |
|
| 48 |
--source include/rpl_connection_master.inc |
| 49 |
# error because the value already exists in the table in the slave |
| 50 |
INSERT INTO t1_nontrans VALUES (1); |
| 51 |
--source include/sync_slave_sql_with_master.inc |
| 52 |
|
| 53 |
--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) |
| 54 |
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1) |
| 55 |
|
| 56 |
--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after INSERT |
| 57 |
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos |
| 58 |
--source include/assert.inc |
| 59 |
|
| 60 |
--source include/rpl_connection_master.inc |
| 61 |
# error because the value already exists in the table in the slave |
| 62 |
BEGIN; |
| 63 |
INSERT INTO t1_nontrans VALUES (2); |
| 64 |
COMMIT; |
| 65 |
--source include/sync_slave_sql_with_master.inc |
| 66 |
|
| 67 |
--let $exec_master_log_pos= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1) |
| 68 |
--let $read_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1) |
| 69 |
|
| 70 |
--let $assert_text= exec_master_log_pos should be equal to read_master_log_pos after INSERT inside transaction |
| 71 |
--let $assert_cond= $exec_master_log_pos = $read_master_log_pos |
| 72 |
--source include/assert.inc |
| 73 |
|
| 74 |
# cleanup |
| 75 |
--source include/rpl_connection_master.inc |
| 76 |
DROP TABLE t1_nontrans, t2_nontrans; |
| 77 |
--source include/sync_slave_sql_with_master.inc |
| 78 |
--source include/rpl_connection_master.inc |
| 79 |
--source include/rpl_end.inc |