| 1 |
--source include/force_myisam_default.inc |
| 2 |
--source include/have_myisam.inc |
| 3 |
--source include/have_log_bin.inc |
| 4 |
--source extra/binlog_tests/binlog_innodb.inc |
| 5 |
# |
| 6 |
# Bug#27716 multi-update did partially and has not binlogged |
| 7 |
# |
| 8 |
|
| 9 |
CREATE TABLE `t1` ( |
| 10 |
`a` int(11) NOT NULL auto_increment, |
| 11 |
`b` int(11) default NULL, |
| 12 |
PRIMARY KEY (`a`) |
| 13 |
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; |
| 14 |
|
| 15 |
CREATE TABLE `t2` ( |
| 16 |
`a` int(11) NOT NULL auto_increment, |
| 17 |
`b` int(11) default NULL, |
| 18 |
PRIMARY KEY (`a`) |
| 19 |
) ENGINE=INNODB DEFAULT CHARSET=latin1 ; |
| 20 |
|
| 21 |
# A. testing multi_update::send_eof() execution branch |
| 22 |
insert into t1 values (1,1),(2,2); |
| 23 |
insert into t2 values (1,1),(4,4); |
| 24 |
reset master; |
| 25 |
--error ER_DUP_ENTRY |
| 26 |
UPDATE t2,t1 SET t2.a=t1.a+2; |
| 27 |
# check |
| 28 |
select * from t2 /* must be (3,1), (4,4) */; |
| 29 |
--echo # There must no UPDATE in binlog; |
| 30 |
source include/show_binlog_events.inc; |
| 31 |
|
| 32 |
# B. testing multi_update::send_error() execution branch |
| 33 |
delete from t1; |
| 34 |
delete from t2; |
| 35 |
insert into t1 values (1,2),(3,4),(4,4); |
| 36 |
insert into t2 values (1,2),(3,4),(4,4); |
| 37 |
reset master; |
| 38 |
--error ER_DUP_ENTRY |
| 39 |
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; |
| 40 |
--echo # There must be no UPDATE query event; |
| 41 |
source include/show_binlog_events.inc; |
| 42 |
|
| 43 |
# cleanup bug#27716 |
| 44 |
drop table t1, t2; |
| 45 |
|
| 46 |
--echo End of tests |