| 1 |
--source include/not_group_replication_plugin.inc |
| 2 |
source include/force_myisam_default.inc; |
| 3 |
source include/have_myisam.inc; |
| 4 |
source include/master-slave.inc; |
| 5 |
|
| 6 |
--echo # Verify the statements can be binlogged correctly when error happens |
| 7 |
--echo # ------------------------------------------------------------------ |
| 8 |
CREATE TABLE t1(c1 INT KEY) ENGINE=MyISAM; |
| 9 |
CREATE TABLE t2(c1 INT KEY) ENGINE=MyISAM; |
| 10 |
INSERT INTO t1 VALUES(1); |
| 11 |
INSERT INTO t2 VALUES(1); |
| 12 |
|
| 13 |
--echo |
| 14 |
--echo # Nothing is inserted. |
| 15 |
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
| 16 |
--error 1062 |
| 17 |
INSERT INTO t1 VALUES(1),(2); |
| 18 |
source include/show_binlog_events.inc; |
| 19 |
|
| 20 |
--echo |
| 21 |
--echo # A row is inserted. |
| 22 |
--error 1062 |
| 23 |
INSERT INTO t1 VALUES(2),(1); |
| 24 |
--source include/sync_slave_sql_with_master.inc |
| 25 |
let $diff_tables= master:test.t1, slave:test.t1; |
| 26 |
source include/diff_tables.inc; |
| 27 |
|
| 28 |
--echo |
| 29 |
--echo # Nothing is inserted. |
| 30 |
connection master; |
| 31 |
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
| 32 |
--error 1062 |
| 33 |
INSERT INTO t1 SELECT 1 UNION SELECT 2; |
| 34 |
source include/show_binlog_events.inc; |
| 35 |
|
| 36 |
--echo |
| 37 |
--echo # A row is inserted. |
| 38 |
--error 1062 |
| 39 |
INSERT INTO t1 SELECT 3 UNION SELECT 2; |
| 40 |
--source include/sync_slave_sql_with_master.inc |
| 41 |
source include/diff_tables.inc; |
| 42 |
|
| 43 |
|
| 44 |
--echo |
| 45 |
--echo # A row is updated. |
| 46 |
connection master; |
| 47 |
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
| 48 |
--error 1062 |
| 49 |
UPDATE t1 SET c1=4; |
| 50 |
--source include/sync_slave_sql_with_master.inc |
| 51 |
source include/diff_tables.inc; |
| 52 |
|
| 53 |
--echo # Nothing is updated. |
| 54 |
connection master; |
| 55 |
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
| 56 |
--error 1062 |
| 57 |
UPDATE t1 SET c1=4; |
| 58 |
source include/show_binlog_events.inc; |
| 59 |
|
| 60 |
--echo |
| 61 |
--echo # A row is updated. |
| 62 |
connection master; |
| 63 |
--error 1062 |
| 64 |
UPDATE t1, t2 SET t1.c1= 5, t2.c1=5; |
| 65 |
--source include/sync_slave_sql_with_master.inc |
| 66 |
source include/diff_tables.inc; |
| 67 |
|
| 68 |
--echo |
| 69 |
--echo Nothing is updated. |
| 70 |
connection master; |
| 71 |
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
| 72 |
--error 1062 |
| 73 |
UPDATE t1, t2 SET t1.c1= 5, t2.c1=5; |
| 74 |
source include/show_binlog_events.inc; |
| 75 |
|
| 76 |
DROP TABLE t1, t2; |
| 77 |
source include/rpl_end.inc; |