Bug #25817 UPDATE IGNORE doesn't check write_set when checking unique indexes
Submitted: 24 Jan 2007 10:36 Modified: 5 Nov 2007 22:17
Reporter: Mikael Ronström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:Red Hat OS:Any
Assigned to: Martin Skold CPU Architecture:Any

[24 Jan 2007 10:36] Mikael Ronström
Description:
UPDATE IGNORE for NDB handler will use unitialised data
to check for ignore duplicate key errors

How to repeat:
CREATE TABLE t1 (a int not null primary key, b int not null, c int not null,
                 unique (b), unique (c))
engine ndb;

insert into t1 values (1,1,75),(1,57,79),(2,2,2);
update t1 set c = 4 where a = 2;
update ignore t1 set b = 55 where a = 1;

This can report a failure on the last attempted update due to
that randomly c = 4 is 4 in the new record (uninitialised value)
which is then used to check that no conflicts occur which it
will then report.

Suggested fix:
Ensure that only unique indexes that are part of write_set will
be checked for duplicate key ignorance.
[2 Oct 2007 11: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/34751

ChangeSet@1.2483, 2007-10-02 13:36:13+02:00, mskold@mysql.com +4 -0
  Bug#25817  UPDATE IGNORE doesn't check write_set when checking unique indexes: Added checks
[3 Oct 2007 7:54] 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/34808

ChangeSet@1.2562, 2007-10-03 09:54:33+02:00, mskold@mysql.com +1 -0
  Bug#25817  UPDATE IGNORE doesn't check write_set when checking unique indexes: Post merge 5.0->5.1
[5 Nov 2007 13:53] Bugs System
Pushed into 6.0.4-alpha
[5 Nov 2007 13:56] Bugs System
Pushed into 5.1.23-rc
[5 Nov 2007 13:58] Bugs System
Pushed into 5.0.52
[5 Nov 2007 22:17] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.0.52, 5.1.23, and 6.0.4 changelogs. Closed.
[8 Nov 2007 14:34] Jon Stephens
Also documented fix in 5.1.22-ndb-6.2.8 and 5.1.22-ndb-6.3.6 changelogs (per release notes from Tomas).