diff options
author | unknown <aelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi> | 2007-06-01 11:14:04 +0300 |
---|---|---|
committer | unknown <aelkin/elkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi> | 2007-06-01 11:14:04 +0300 |
commit | 6b94fc579fdf3ddf4905a5b2c3c9e76d445f1304 (patch) | |
tree | e734e33ae28cf73ae86a6a49e056ab272eec54f6 /mysql-test/t/innodb.test | |
parent | 199dab236da0713d575b421ddd632232905a1022 (diff) | |
download | mariadb-git-6b94fc579fdf3ddf4905a5b2c3c9e76d445f1304.tar.gz |
Bug #27716 multi-update did partially and has not binlogged
Implementation of mysql_multi_update did not call multi_update::send_error method in some cases
(see the test reported on bug page and test cases in changeset).
Fixed with deploying the method, ::send_error() is refined to get binlogging code which works whenever
there is modified non-transactional table.
thd->no_trans_update.stmt flag is set in to TRUE to ease testing though being the beginning of relative
bug#27417 fix (addresses a part of those issues).
Eliminating two minor issues (small bugs) in multi_update methods.
This patch for multi-update also addresses a part of the issues reported in bug#13270,bug#23333.
mysql-test/r/innodb.result:
result changed
mysql-test/r/multi_update.result:
results changed
mysql-test/t/innodb.test:
regression test for the bug combining transactional and non-transaction tables
mysql-test/t/multi_update.test:
regression tests added - erred query must be binlogged
sql/sql_update.cc:
making a call to multi_update::send_error when mysql_select return an error;
deploying binlogging inside of ::send_error;
refining multi_update::send_eof() to mark binlogging work done when its call to ::do_updates() errs
and the query is binlogged with the error. ::send_error() will be called after all but
do not do anything;
thd->no_trans_update.stmt is corrected to be set to TRUE according to the existed code pattern.
Although this part relates to another bugs (bug#27417 etc) it is needed here for testing;
Eliminating a separate issue in multi_update::do_updates where
either one of the class members trans_safe, transactional_tables was
set after the per-table loop whereas both should be calculated during
looping.
Eliminating a separate issue in ::send_eof() where thd->no_trans_update.all won't be set TRUE when
amoung others there'd be at least one modified transactional table.
Binlogging is done to satisfy to general character bug#13270,bug#23333 so that those won't have
fixes specific for multi-update.
Diffstat (limited to 'mysql-test/t/innodb.test')
-rw-r--r-- | mysql-test/t/innodb.test | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index e762d740d66..3d5443a7200 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -754,6 +754,45 @@ select * from t2; drop table t1,t2; # +# Bug#27716 multi-update did partially and has not binlogged +# + +CREATE TABLE `t1` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 ; + +CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`) +) ENGINE=INNODB DEFAULT CHARSET=latin1 ; + +# A. testing multi_update::send_eof() execution branch +insert into t1 values (1,1),(2,2); +insert into t2 values (1,1),(4,4); +reset master; +--error ER_DUP_ENTRY +UPDATE t2,t1 SET t2.a=t1.a+2; +# check +select * from t2 /* must be (3,1), (4,4) */; +show master status /* there must no UPDATE in binlog */; + +# B. testing multi_update::send_error() execution branch +delete from t1; +delete from t2; +insert into t1 values (1,2),(3,4),(4,4); +insert into t2 values (1,2),(3,4),(4,4); +reset master; +--error ER_DUP_ENTRY +UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; +show master status /* there must be no UPDATE query event */; + +# cleanup bug#27716 +drop table t1, t2; + +# # Testing of IFNULL # create table t1 (a int, b int) engine=innodb; |