| 1 |
drop table if exists t1,t2; |
| 2 |
create table t1(a int, unique(a)); |
| 3 |
insert into t1 values(2); |
| 4 |
create table t2(a int); |
| 5 |
insert into t2 values(1),(2); |
| 6 |
reset master; |
| 7 |
insert into t1 select * from t2; |
| 8 |
ERROR 23000: Duplicate entry '2' for key 't1.a' |
| 9 |
include/show_binlog_events.inc |
| 10 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 11 |
binlog.000001 # Query # # BEGIN |
| 12 |
binlog.000001 # Query # # use `test`; insert into t1 select * from t2 |
| 13 |
binlog.000001 # Query # # COMMIT |
| 14 |
select * from t1; |
| 15 |
a |
| 16 |
1 |
| 17 |
2 |
| 18 |
drop table t1, t2; |
| 19 |
create table t1(a int); |
| 20 |
insert into t1 values(1),(1); |
| 21 |
reset master; |
| 22 |
create table t2(unique(a)) select a from t1; |
| 23 |
ERROR 23000: Duplicate entry '1' for key 't2.a' |
| 24 |
include/show_binlog_events.inc |
| 25 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 26 |
drop table t1; |