Commit c4471eef authored by vasil's avatar vasil

branches/5.1:

Merge change from MySQL AB:

ChangeSet@1.2541, 2007-10-13 15:49:42+03:00, aelkin@koti.dsl.inet.fi +10 -0
  Bug #29136 erred multi-delete on trans table does not rollback the statement
 
  similar to bug_27716, but it was stressed on in the synopsis on that there is another
  side of the artifact affecting behaviour in transaction.

  Fixed with deploying multi_delete::send_error() - otherwise never called - and refining its logic
  to perform binlogging job if needed.

  The changeset includes the following side effects:
  - added tests to check bug_23333's scenarios on the mixture of tables for multi_update;
  - fixes bug@30763 with two-liner patch and a test coinciding to one added for bug_23333.
  
  mysql-test/r/innodb.result@1.171, 2007-10-13 15:49:36+03:00, aelkin@koti.dsl.inet.fi +15 -2
    results changed

  mysql-test/t/innodb.test@1.145, 2007-10-13 15:49:37+03:00, aelkin@koti.dsl.inet.fi +32 -0
    trans table specific test added
parent a38c2a73
...@@ -1049,6 +1049,19 @@ n d ...@@ -1049,6 +1049,19 @@ n d
1 30 1 30
2 20 2 20
drop table t1,t2; drop table t1,t2;
drop table if exists t1, t2;
CREATE TABLE t1 (a int, PRIMARY KEY (a));
CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
create trigger trg_del_t2 after delete on t2 for each row
insert into t1 values (1);
insert into t1 values (1);
insert into t2 values (1),(2);
delete t2 from t2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
count(*)
2
drop table t1, t2;
create table t1 (a int, b int) engine=innodb; create table t1 (a int, b int) engine=innodb;
insert into t1 values(20,null); insert into t1 values(20,null);
select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
......
...@@ -720,6 +720,38 @@ select * from t1; ...@@ -720,6 +720,38 @@ select * from t1;
select * from t2; select * from t2;
drop table t1,t2; drop table t1,t2;
#
# Bug #29136 erred multi-delete on trans table does not rollback
#
# prepare
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
CREATE TABLE t1 (a int, PRIMARY KEY (a));
CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
create trigger trg_del_t2 after delete on t2 for each row
insert into t1 values (1);
insert into t1 values (1);
insert into t2 values (1),(2);
# exec cases A, B - see multi_update.test
# A. send_error() w/o send_eof() branch
--error ER_DUP_ENTRY
delete t2 from t2;
# check
select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
# cleanup bug#29136
drop table t1, t2;
# #
# Testing of IFNULL # Testing of IFNULL
# #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment