Bug #16901 Partitions: crash, SELECT, column of part. function=first column of primary key
Submitted: 30 Jan 2006 13:14 Modified: 16 Feb 2006 14:37
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S2 (Serious)
Version:5.1 OS:
Assigned to: Sergei Glukhov CPU Architecture:Any

[30 Jan 2006 13:14] Matthias Leich
Description:
SET SESSION storage_engine='MyISAM';
CREATE TABLE t1 (
f_int1 INTEGER,f_int2 INTEGER, f_char1 VARCHAR(10)
, PRIMARY KEY(f_int1,f_int2))
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int2) SUBPARTITIONS 2
(PARTITION parta VALUES LESS THAN (0),
PARTITION parte VALUES LESS THAN (2),
PARTITION partf VALUES LESS THAN  (2147483647));
SELECT * FROM t1 WHERE f_int1 = 2;
f_int1	f_int2	f_char1
INSERT INTO t1 VALUES(2,2,'####2####');
SELECT * FROM t1 WHERE f_int1 = 3;
f_int1	f_int2	f_char1
INSERT INTO t1 VALUES(3,3,'####3####');
SELECT * FROM t1 WHERE f_int1 = 4;
At line 35: query 'SELECT * FROM t1 WHERE f_int1 = 4' failed: 2013: Lost connection to MySQL server during query

It looks like the crash appears under the following conditions
# 1. storage engine used for table in (MyISAM,InnoDB)
#    MEMORY and BDB are harmless at least with the following statements
# 2. first column of PRIMARY KEY/UNIQUE INDEX = 
#                            single column used in function for PARTITIONS
# 3. SUBPARTITIONING is used
# 4. Two INSERTs INTO the last RANGE partition
# 5. SELECT on the last partition

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

How to repeat:
Please execute the statements above or use my attached 
testscript ml017.test
  copy it to mysql-test/t
  echo "Dummy" > r/ml017.result   # Produce a dummy file with 
                                                   # expected results
  ./mysql-test-run ml017
[30 Jan 2006 13:16] Matthias Leich
test script with comments and alternative cases/statements

Attachment: ml017.test (application/test, text), 2.35 KiB.

[30 Jan 2006 13:17] Matthias Leich
master.err

Attachment: master.err (application/octet-stream, text), 3.02 KiB.

[31 Jan 2006 14:41] 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/1945
[15 Feb 2006 9:38] 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/2634
[15 Feb 2006 10:34] Sergei Glukhov
Fixed in 5.1.7
[16 Feb 2006 14:37] 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 bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.1.7 changelog; closed.