Bug #18735 Partitions: NDB, UNIQUE INDEX, UPDATE, strange server response
Submitted: 3 Apr 2006 10:26 Modified: 1 Aug 2007 22:10
Reporter: Matthias Leich Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: Partitions Severity:S2 (Serious)
Version:5.1 OS:Any
Assigned to: Mikael Ronström CPU Architecture:Any

[3 Apr 2006 10:26] Matthias Leich
Description:
Unexpected server response on UPDATE

partition_basic_ndb            [ fail ]
Errors are (from /dev/shm/var/log/mysqltest-time) :
mysqltest: In included file "./suite/partitions/include/partition_check.inc": At line 398: query 'UPDATE t1 SET f_int1 = @cur_value1
WHERE  f_int1 = @cur_value2 AND f_charbig = '#SINGLE#'' failed: 1032: Can't find record in 't1'
The table definition was:
CREATE TABLE t1 (f_int1 INTEGER,f_int2 INTEGER,
f_char1 CHAR(10),f_char2 CHAR(10),f_charbig VARCHAR(1000),
UNIQUE INDEX (f_int2))
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;

This bug is probably a duplicate of
  Bug#18730: Partitions: NDB, crash on SELECT MIN(<unique column>)

My environment:
   - Intel PC with Linux(SuSE 9.3)
   - MySQL compiled from source
         Version 5.1 last ChangeSet@1.2277, 2006-04-01

How to repeat:
Execute the currently not pushed testsuite for the partitioning feature.
[3 Apr 2006 19:08] Matthias Leich
CREATE TABLE t1 (f_int1 INTEGER,f_int2 INTEGER,
f_char1 CHAR(10),f_char2 CHAR(10),f_charbig VARCHAR(1000)
) ENGINE= NDB
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
# Attention: PARTITION BY HASH(f_int1) PARTITIONS 2
#                 removes the bug.
INSERT INTO t1 (f_int1,f_int2,f_char1,f_char2,f_charbig)
VALUES
( 0,0,'0','0','#SINGLE#'),
( 1,1,'1','1','===1==='),
( 2,2 ,'2','2','===2==='),
( 3,3,'3','3','===3==='),
( 4,4 ,'4','4','===4==='),
( 16,16,'16','16','===16==='),
( 17,17,'17','17','===17==='),
( 18,18,'18','18','===18==='),
( 19,19,'19','19','===19==='),
( 20,20,'20','20','===20==='),
( 21,21,'21','21','#SINGLE#');
# This update seems to be needed.
UPDATE t1 SET f_int1 = 22
WHERE  f_int1 = 0 AND f_charbig = '#SINGLE#';
UPDATE t1 SET f_int1 = -1
WHERE  f_int1 = 22 AND f_charbig = '#SINGLE#';
<-------------   
mysqltest: At line 35: query 'UPDATE t1 SET f_int1 = -1
WHERE  f_int1 = 22 AND f_charbig = '#SINGLE#'' failed: 1032: Can't find record in 't1'
Please use the attached file ndb_ml007.test for replaying the bug.
[3 Apr 2006 19:09] Matthias Leich
testscript

Attachment: ndb_ml007.test (application/test, text), 1.05 KiB.

[1 Jul 2008 10:54] Mattias Jonsson
Related to bug#36735.