Bug #39538 Constraint violation in multi-row insert does not abort transaction
Submitted: 19 Sep 2008 14:48 Modified: 8 Oct 2008 7:33
Reporter: Martin Skold Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.1-telco-6.3 OS:Any
Assigned to: Tomas Ulin CPU Architecture:Any

[19 Sep 2008 14:48] Martin Skold
Description:
Given a table:
create table t1(x int primary key, y int) engine = ndb;
and
insert into t1 values (1,1);

In a multi-row insert statement with a constraint violation
the transaction for the autocommitted statement is
not rolled back, resulting in rows being incorrectly inserted.

mysql> insert into t1 values (-1,-1),(1,2),(9999,9999);
ERROR 1022 (23000): Can't write; duplicate key in table 't1'
mysql> select * from t1;
+------+------+
| x    | y    |
+------+------+
|   -1 |   -1 | 
|    1 |    1 | 
| 9999 | 9999 | 
+------+------+

How to repeat:
Run test
ndb_insert.test
[29 Sep 2008 16:22] 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/54671

2689 Tomas Ulin	2008-09-29
      Bug #39538 Constraint violation in multi-row insert does not abort transaction
[29 Sep 2008 16:22] 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/54672

2689 Tomas Ulin	2008-09-29
      Bug #39538 Constraint violation in multi-row insert does not abort transaction
[5 Oct 2008 17:46] Jon Stephens
Documented in the 5.1.28-ndb-6.3.18 changelog as follows:

        When a transaction included a multi-row insert to an NDBCLUSTER table
        that caused a constraint violation, the transaction failed to roll back.

Left status unchanged pending telco-6.2 merge.
[8 Oct 2008 7:33] Tomas Ulin
bug not in 6.2