| 1 |
CREATE TABLE `t1` ( |
| 2 |
`a` int(11) NOT NULL auto_increment, |
| 3 |
`b` int(11) default NULL, |
| 4 |
PRIMARY KEY (`a`) |
| 5 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; |
| 6 |
Warnings: |
| 7 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 8 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 9 |
CREATE TABLE `t2` ( |
| 10 |
`a` int(11) NOT NULL auto_increment, |
| 11 |
`b` int(11) default NULL, |
| 12 |
PRIMARY KEY (`a`) |
| 13 |
) ENGINE=INNODB DEFAULT CHARSET=latin1 ; |
| 14 |
Warnings: |
| 15 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 16 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 17 |
insert into t1 values (1,1),(2,2); |
| 18 |
insert into t2 values (1,1),(4,4); |
| 19 |
reset master; |
| 20 |
UPDATE t2,t1 SET t2.a=t1.a+2; |
| 21 |
ERROR 23000: Duplicate entry '3' for key 't2.PRIMARY' |
| 22 |
select * from t2 /* must be (3,1), (4,4) */; |
| 23 |
a b |
| 24 |
1 1 |
| 25 |
4 4 |
| 26 |
# There must no UPDATE in binlog; |
| 27 |
include/show_binlog_events.inc |
| 28 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 29 |
delete from t1; |
| 30 |
delete from t2; |
| 31 |
insert into t1 values (1,2),(3,4),(4,4); |
| 32 |
insert into t2 values (1,2),(3,4),(4,4); |
| 33 |
reset master; |
| 34 |
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; |
| 35 |
ERROR 23000: Duplicate entry '4' for key 't2.PRIMARY' |
| 36 |
# There must be no UPDATE query event; |
| 37 |
include/show_binlog_events.inc |
| 38 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 39 |
drop table t1, t2; |
| 40 |
End of tests |