| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); |
| 4 |
connection master; |
| 5 |
CREATE TABLE t1 ( |
| 6 |
a int unsigned not null auto_increment primary key, |
| 7 |
b int unsigned, |
| 8 |
unique (b) |
| 9 |
) ENGINE=innodb; |
| 10 |
CREATE TABLE t2 ( |
| 11 |
a int unsigned, # to force INSERT SELECT to have a certain order |
| 12 |
b int unsigned |
| 13 |
) ENGINE=innodb; |
| 14 |
INSERT INTO t1 VALUES (NULL, 1); |
| 15 |
INSERT INTO t1 VALUES (NULL, 2); |
| 16 |
INSERT INTO t1 VALUES (NULL, 3); |
| 17 |
INSERT INTO t1 VALUES (NULL, 4); |
| 18 |
INSERT INTO t2 VALUES (1, 1); |
| 19 |
INSERT INTO t2 VALUES (2, 2); |
| 20 |
INSERT INTO t2 VALUES (3, 5); |
| 21 |
INSERT INTO t2 VALUES (4, 3); |
| 22 |
INSERT INTO t2 VALUES (5, 4); |
| 23 |
INSERT INTO t2 VALUES (6, 6); |
| 24 |
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; |
| 25 |
include/assert.inc [Count of elements in t1 should be 6.] |
| 26 |
connection slave; |
| 27 |
include/diff_tables.inc [master:test.t1 , slave:test.t1] |
| 28 |
connection master; |
| 29 |
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; |
| 30 |
include/assert.inc [Count of elements in t1 should be 6.] |
| 31 |
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] |
| 32 |
DROP TABLE t1; |
| 33 |
DROP TABLE t2; |
| 34 |
CREATE TABLE t1 ( |
| 35 |
a INT UNSIGNED NOT NULL PRIMARY KEY |
| 36 |
) ENGINE=innodb; |
| 37 |
CREATE TABLE t2 ( |
| 38 |
a INT UNSIGNED |
| 39 |
) ENGINE=innodb; |
| 40 |
INSERT INTO t1 VALUES (1); |
| 41 |
INSERT INTO t2 VALUES (1); |
| 42 |
INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a; |
| 43 |
include/assert.inc [Sum of elements in t1 should be 1.] |
| 44 |
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] |
| 45 |
connection master; |
| 46 |
drop table t1, t2; |
| 47 |
connection slave; |
| 48 |
connection master; |
| 49 |
CREATE TABLE t1 ( |
| 50 |
a int unsigned not null auto_increment primary key, |
| 51 |
b int unsigned, |
| 52 |
unique (b) |
| 53 |
) ENGINE=myisam; |
| 54 |
CREATE TABLE t2 ( |
| 55 |
a int unsigned, # to force INSERT SELECT to have a certain order |
| 56 |
b int unsigned |
| 57 |
) ENGINE=myisam; |
| 58 |
INSERT INTO t1 VALUES (NULL, 1); |
| 59 |
INSERT INTO t1 VALUES (NULL, 2); |
| 60 |
INSERT INTO t1 VALUES (NULL, 3); |
| 61 |
INSERT INTO t1 VALUES (NULL, 4); |
| 62 |
INSERT INTO t2 VALUES (1, 1); |
| 63 |
INSERT INTO t2 VALUES (2, 2); |
| 64 |
INSERT INTO t2 VALUES (3, 5); |
| 65 |
INSERT INTO t2 VALUES (4, 3); |
| 66 |
INSERT INTO t2 VALUES (5, 4); |
| 67 |
INSERT INTO t2 VALUES (6, 6); |
| 68 |
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; |
| 69 |
include/assert.inc [Count of elements in t1 should be 6.] |
| 70 |
connection slave; |
| 71 |
include/diff_tables.inc [master:test.t1 , slave:test.t1] |
| 72 |
connection master; |
| 73 |
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; |
| 74 |
include/assert.inc [Count of elements in t1 should be 6.] |
| 75 |
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] |
| 76 |
DROP TABLE t1; |
| 77 |
DROP TABLE t2; |
| 78 |
CREATE TABLE t1 ( |
| 79 |
a INT UNSIGNED NOT NULL PRIMARY KEY |
| 80 |
) ENGINE=myisam; |
| 81 |
CREATE TABLE t2 ( |
| 82 |
a INT UNSIGNED |
| 83 |
) ENGINE=myisam; |
| 84 |
INSERT INTO t1 VALUES (1); |
| 85 |
INSERT INTO t2 VALUES (1); |
| 86 |
INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a; |
| 87 |
include/assert.inc [Sum of elements in t1 should be 1.] |
| 88 |
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.] |
| 89 |
connection master; |
| 90 |
drop table t1, t2; |
| 91 |
connection slave; |
| 92 |
include/rpl_end.inc |