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);
7
insert into t1 select * from t2;
8
ERROR 23000: Duplicate entry '2' for key 'a'
9
show binlog events from <binlog_start>;
10
Log_name Pos Event_type Server_id End_log_pos Info
11
master-bin.000001 # Query # # use `test`; BEGIN
12
master-bin.000001 # Table_map # # table_id: # (test.t1)
13
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
14
master-bin.000001 # Query # # use `test`; ROLLBACK
20
create table t1(a int);
21
insert into t1 values(1),(1);
23
create table t2(unique(a)) select a from t1;
24
ERROR 23000: Duplicate entry '1' for key 'a'
25
show binlog events from <binlog_start>;
26
Log_name Pos Event_type Server_id End_log_pos Info