Bug #29136 erred multi-delete on trans table does not rollback the statement
Submitted: 15 Jun 2007 12:21 Modified: 12 Dec 2007 20:39
Reporter: Andrei Elkin
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:5.0.20, 5.1 OS:Any
Assigned to: Andrei Elkin Target Version:5.1
Triage: D4 (Minor)

[15 Jun 2007 12:21] Andrei Elkin
Description:
This is similar to bug#27716 issue of lack of ::send_error() invokation in the case of an
error.
An observed consequence is that multi-delete on trans table can perform partially.
Another side is in that there is no binlogging if the query has non-trans table modified
side effect. 

How to repeat:
# prepare

CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
CREATE TABLE t1 (a int, PRIMARY KEY (a));

create trigger trg_del after  delete on t2 for each row
       insert into t1 values (1);

insert into t1 values (1);
insert into t2 values (1),(2);

# exec

delete t2 from t2; # ERROR 1062 (23000): Duplicate entry '1' for key 1

# check

select * from t2 /* must be (2) left */;

Suggested fix:
Similar to bug#27716.
[23 Jun 2007 15:37] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/29450

ChangeSet@1.2522, 2007-06-23 16:33:39+03:00, aelkin@dsl-hkibras1-ff5dc300-70.dhcp.inet.fi
+7 -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.
  A small refinement for the related bug's fix
[9 Oct 2007 11:44] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35185

ChangeSet@1.2541, 2007-10-09 12:44:02+03:00, aelkin@dsl-hkibras-fe2ef900-212.dhcp.inet.fi
+9 -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.
[9 Oct 2007 14:15] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35193

ChangeSet@1.2541, 2007-10-09 15:15:30+03:00, aelkin@dsl-hkibras-fe2ef900-212.dhcp.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.
[9 Oct 2007 14:20] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35194

ChangeSet@1.2541, 2007-10-09 15:19:53+03:00, aelkin@dsl-hkibras-fe2ef900-212.dhcp.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.
[12 Oct 2007 16:19] Chuck Bell
Patch ok to push.
[13 Oct 2007 14:50] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35510

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.
[27 Nov 2007 11:49] Bugs System
Pushed into 5.0.54
[27 Nov 2007 11:50] Bugs System
Pushed into 5.1.23-rc
[27 Nov 2007 11:53] Bugs System
Pushed into 6.0.4-alpha
[12 Dec 2007 20:39] Paul DuBois
Noted in 5.0.54, 5.1.23, 6.0.4 changelogs.

For transactional tables, an error during a multiple-table DELETE
statement did not roll back the statement.