| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
ALTER TABLE mysql.gtid_slave_pos ENGINE = InnoDB; |
| 5 |
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) Engine=InnoDB; |
| 6 |
connection slave; |
| 7 |
connection slave; |
| 8 |
include/stop_slave.inc |
| 9 |
SET sql_log_bin= 0; |
| 10 |
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); |
| 11 |
INSERT INTO t1 VALUES (1, 2); |
| 12 |
SET sql_log_bin= 1; |
| 13 |
Contents on slave before: |
| 14 |
SELECT * FROM t1 ORDER BY a; |
| 15 |
a b |
| 16 |
1 2 |
| 17 |
SET @old_parallel= @@GLOBAL.slave_parallel_threads; |
| 18 |
SET GLOBAL slave_parallel_threads=8; |
| 19 |
connection master; |
| 20 |
CREATE TEMPORARY TABLE t2 LIKE t1; |
| 21 |
INSERT INTO t2 VALUE (1, 1); |
| 22 |
INSERT INTO t2 VALUE (2, 1); |
| 23 |
INSERT INTO t2 VALUE (3, 1); |
| 24 |
INSERT INTO t2 VALUE (4, 1); |
| 25 |
INSERT INTO t2 VALUE (5, 1); |
| 26 |
INSERT INTO t1 SELECT * FROM t2; |
| 27 |
DROP TEMPORARY TABLE t2; |
| 28 |
INSERT INTO t1 VALUE (6, 3); |
| 29 |
include/save_master_gtid.inc |
| 30 |
Contents on master: |
| 31 |
SELECT * FROM t1 ORDER BY a; |
| 32 |
a b |
| 33 |
1 1 |
| 34 |
2 1 |
| 35 |
3 1 |
| 36 |
4 1 |
| 37 |
5 1 |
| 38 |
6 3 |
| 39 |
connection slave; |
| 40 |
START SLAVE; |
| 41 |
include/wait_for_slave_sql_error.inc [errno=1062] |
| 42 |
STOP SLAVE IO_THREAD; |
| 43 |
Contents on slave on slave error: |
| 44 |
SELECT * FROM t1 ORDER BY a; |
| 45 |
a b |
| 46 |
1 2 |
| 47 |
SET sql_log_bin= 0; |
| 48 |
DELETE FROM t1 WHERE a=1; |
| 49 |
SET sql_log_bin= 1; |
| 50 |
include/start_slave.inc |
| 51 |
include/sync_with_master_gtid.inc |
| 52 |
Contents on slave after: |
| 53 |
SELECT * FROM t1 ORDER BY a; |
| 54 |
a b |
| 55 |
1 1 |
| 56 |
2 1 |
| 57 |
3 1 |
| 58 |
4 1 |
| 59 |
5 1 |
| 60 |
6 3 |
| 61 |
connection master; |
| 62 |
DROP TABLE t1; |
| 63 |
connection slave; |
| 64 |
include/stop_slave.inc |
| 65 |
SET GLOBAL slave_parallel_threads= @old_parallel; |
| 66 |
include/start_slave.inc |
| 67 |
include/rpl_end.inc |