| 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 |
create table t1(a int auto_increment, primary key(a)); |
| 5 |
create table t2(b int auto_increment, c int, primary key(b)); |
| 6 |
insert into t1 values (1),(2),(3); |
| 7 |
insert into t1 values (null); |
| 8 |
insert into t2 values (null,last_insert_id()); |
| 9 |
connection slave; |
| 10 |
select * from t1 ORDER BY a; |
| 11 |
a |
| 12 |
1 |
| 13 |
2 |
| 14 |
3 |
| 15 |
4 |
| 16 |
select * from t2 ORDER BY b; |
| 17 |
b c |
| 18 |
1 4 |
| 19 |
connection master; |
| 20 |
drop table t1; |
| 21 |
drop table t2; |
| 22 |
create table t1(a int auto_increment, key(a)) engine=innodb; |
| 23 |
create table t2(b int auto_increment, c int, key(b), foreign key(b) references t1(a)) engine=innodb; |
| 24 |
SET FOREIGN_KEY_CHECKS=0; |
| 25 |
insert into t1 values (10); |
| 26 |
insert into t1 values (null),(null),(null); |
| 27 |
insert into t2 values (5,0); |
| 28 |
insert into t2 values (null,last_insert_id()); |
| 29 |
SET FOREIGN_KEY_CHECKS=1; |
| 30 |
connection slave; |
| 31 |
select * from t1; |
| 32 |
a |
| 33 |
10 |
| 34 |
11 |
| 35 |
12 |
| 36 |
13 |
| 37 |
select * from t2; |
| 38 |
b c |
| 39 |
5 0 |
| 40 |
6 11 |
| 41 |
connection master; |
| 42 |
drop table t2; |
| 43 |
drop table t1; |
| 44 |
create table t1(a int auto_increment, primary key(a)); |
| 45 |
create table t2(b int auto_increment, c int, primary key(b)); |
| 46 |
insert into t1 values (10); |
| 47 |
insert into t1 values (null),(null),(null); |
| 48 |
insert into t2 values (5,0); |
| 49 |
insert into t2 (c) select * from t1 ORDER BY a; |
| 50 |
select * from t2 ORDER BY b; |
| 51 |
b c |
| 52 |
5 0 |
| 53 |
6 10 |
| 54 |
7 11 |
| 55 |
8 12 |
| 56 |
9 13 |
| 57 |
connection slave; |
| 58 |
select * from t1 ORDER BY a; |
| 59 |
a |
| 60 |
10 |
| 61 |
11 |
| 62 |
12 |
| 63 |
13 |
| 64 |
select * from t2 ORDER BY b; |
| 65 |
b c |
| 66 |
5 0 |
| 67 |
6 10 |
| 68 |
7 11 |
| 69 |
8 12 |
| 70 |
9 13 |
| 71 |
connection master; |
| 72 |
drop table t1; |
| 73 |
drop table t2; |
| 74 |
connection slave; |
| 75 |
connection master; |
| 76 |
SET TIMESTAMP=1000000000; |
| 77 |
CREATE TABLE t1 ( a INT UNIQUE ); |
| 78 |
SET FOREIGN_KEY_CHECKS=0; |
| 79 |
INSERT INTO t1 VALUES (1),(1); |
| 80 |
Got one of the listed errors |
| 81 |
connection slave; |
| 82 |
connection master; |
| 83 |
drop table t1; |
| 84 |
include/rpl_end.inc |