Bug #34208 | Wrong select results returned by cluster | ||
---|---|---|---|
Submitted: | 31 Jan 2008 21:55 | Modified: | 2 Apr 2008 19:35 |
Reporter: | Joerg Bruehe | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Cluster: Cluster (NDB) storage engine | Severity: | S2 (Serious) |
Version: | 5.1.23-rc | OS: | Linux (IA64, icc) |
Assigned to: | Kristian Nielsen | CPU Architecture: | Any |
Tags: | sr51RC |
[31 Jan 2008 21:55]
Joerg Bruehe
[19 Feb 2008 15:13]
Kristian Nielsen
Manage to verify on ia64 RHAS4. Build command: CC="icc -static-intel" CXX="icpc -static-intel" CFLAGS="-O3 -g -unroll2 -ip -mp -restrict -no-ftz -no-prefetch" CXXFLAGS="-O3 -g -unroll2 -ip -mp -restrict -no-ftz -no-prefetch" LDFLAGS="" ./configure --disable-shared --with-ndbcluster --without-innodb --with-csv-storage-engine --with-archive-storage-engine --with-blackhole-storage-engine --with-example-storage-engine --with-federated-storage-engine --without-embedded-server --without-bench --with-zlib-dir=bundled --with-big-tables --enable-assembler --enable-local-infile --with-mysqld-user=mysql --with-unix-socket-path=/var/lib/mysql/mysql.sock --with-pic --prefix=/ --with-extra-charsets=all --exec-prefix=/usr --libexecdir=/usr/sbin --libdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var/lib/mysql --infodir=/usr/share/info --includedir=/usr/include --mandir=/usr/share/man --enable-thread-safe-client make Minimal test script: ----------------------------------------------------------------------- -- source include/have_ndb.inc -- source include/not_embedded.inc --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings CREATE TABLE t1 ( pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL UNIQUE ) ENGINE=ndbcluster; INSERT INTO t1 VALUES (10, 0, 0),(14,1,1),(12,2,4); create unique index ib on t1(b); update ignore t1 set b = 55 where pk1 = 14; select * from t1 order by pk1; DROP TABLE t1; -----------------------------------------------------------------------
[7 Mar 2008 14:16]
Kristian Nielsen
The problem occurs during index triggers. For the update of b from 1 to 55, an internal trigger fires to delete the old unique index entry for b=1. But this fails to locate the entry for b=1, hence returns error 626.
[11 Mar 2008 8:39]
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/43740 ChangeSet@1.2533, 2008-03-11 09:38:25+01:00, knielsen@ymer.(none) +1 -0 BUG#34208: Corrupt unique hash index creation due to Intel compiler bug on ia64. Looks like the Intel compiler on ia64 miscompiles post-increments in complex array expressions. This caused unique hash index creation to build a completely wrong index due to using values from the wrong column. Worked-around by moving the increment to a separate statement.
[11 Mar 2008 13:00]
Kristian Nielsen
The patch is quite similar to the one for BUG#31239, though in a completely different part of the code. The expression &list.id[list.sz++] is compiled to the address of the element _after_ increment, not before, so we set list.id[1] instead of list.id[0]. Rewriting to not use autoincrement removes the problem. I strongly suspect a compiler bug here, I do not see anything wrong in the source. However, I was unable to reproduce the problem with a stand-alone example.
[11 Mar 2008 13:45]
Kristian Nielsen
Pushed into mysql-5.1-new-ndb (from there it will eventually be merged into mysql-5.1, mysql-5.1-telco-6.2, mysql-5.1-telco-6.3, mysql-5.1-telco-6.4, mysql-6.0, and mysql-6.0-telco).
[2 Apr 2008 19:35]
Jon Stephens
Documented in the 5.1.23-ndb-6.3.11 changelog as follows: An UPDATE that set a new value for a unique key column could cause subsequent queries to fail. Left bug in Patch Queued state pending further merges.
[8 Oct 2008 13:39]
Jon Stephens
Also documented in ndb-6.2.16 changelog.
[12 Dec 2008 23:29]
Bugs System
Pushed into 6.0.6-alpha (revid:sp1r-knielsen@ymer.(none)-20080311083825-20390) (version source revid:sp1r-tomas@poseidon.ndb.mysql.com-20080516085603-30848) (pib:5)