2006-03-01 17:09:39 +01:00
|
|
|
drop table if exists t1,t2;
|
2005-03-30 17:32:44 -08:00
|
|
|
create table t1(a int, unique(a));
|
|
|
|
insert into t1 values(2);
|
|
|
|
create table t2(a int);
|
|
|
|
insert into t2 values(1),(2);
|
|
|
|
reset master;
|
|
|
|
insert into t1 select * from t2;
|
2006-02-13 12:58:33 +01:00
|
|
|
ERROR 23000: Duplicate entry '2' for key 'a'
|
2005-03-30 17:32:44 -08:00
|
|
|
show binlog events;
|
2005-04-04 12:43:58 -07:00
|
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
2005-12-22 06:39:02 +01:00
|
|
|
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
|
2006-02-24 16:19:55 +01:00
|
|
|
master-bin.000001 102 Table_map 1 141 table_id: # (test.t1)
|
|
|
|
master-bin.000001 141 Write_rows 1 175 table_id: # flags: STMT_END_F
|
2005-03-30 17:32:44 -08:00
|
|
|
select * from t1;
|
|
|
|
a
|
|
|
|
1
|
|
|
|
2
|
|
|
|
drop table t1, t2;
|
|
|
|
create table t1(a int);
|
|
|
|
insert into t1 values(1),(1);
|
|
|
|
reset master;
|
|
|
|
create table t2(unique(a)) select a from t1;
|
2006-02-13 12:58:33 +01:00
|
|
|
ERROR 23000: Duplicate entry '1' for key 'a'
|
2005-03-30 17:32:44 -08:00
|
|
|
show binlog events;
|
2005-04-04 12:43:58 -07:00
|
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
2005-12-22 06:39:02 +01:00
|
|
|
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
|
2005-03-30 17:32:44 -08:00
|
|
|
drop table t1;
|