From: Date: January 31 2006 3:46pm Subject: bk commit into 5.1 tree (gluh:1.2101) BUG#16901 List-Archive: http://lists.mysql.com/commits/1945 X-Bug: 16901 Message-Id: <20060131144641.06E92301C2@eagle.intranet.mysql.r18.ru> Below is the list of changes that have just been committed into a local 5.1 repository of gluh. When gluh does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2101 06/01/31 18:46:30 gluh@stripped +3 -0 Fix for bug#16901 Partitions: crash, SELECT, column of part. function=first column of primary key use part_info->no_subparts to calculate partition range in case of subpartitions sql/sql_partition.cc 1.30 06/01/31 18:44:50 gluh@stripped +1 -1 Fix for bug#16901 Partitions: crash, SELECT, column of part. function=first column of primary key use part_info->no_subparts to calculate partition range in case of subpartitions mysql-test/t/partition.test 1.12 06/01/31 18:44:50 gluh@stripped +15 -0 Fix for bug#16901 Partitions: crash, SELECT, column of part. function=first column of primary key test case mysql-test/r/partition.result 1.11 06/01/31 18:44:50 gluh@stripped +11 -0 Fix for bug#16901 Partitions: crash, SELECT, column of part. function=first column of primary key test case # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: gluh # Host: eagle.intranet.mysql.r18.ru # Root: /home/gluh/MySQL/Bugs/5.1.16901 --- 1.10/mysql-test/r/partition.result Wed Jan 18 14:56:17 2006 +++ 1.11/mysql-test/r/partition.result Tue Jan 31 18:44:50 2006 @@ -278,3 +278,14 @@ partition p1 values in (14) insert into t1 values (10,1); ERROR HY000: Table has no partition for value 11 drop table t1; +create table t1 (f1 integer,f2 integer, f3 varchar(10), primary key(f1,f2)) +partition by range(f1) subpartition by hash(f2) subpartitions 2 +(partition p1 values less than (0), +partition p2 values less than (2), +partition p3 values less than (2147483647)); +insert into t1 values(10,10,'10'); +insert into t1 values(2,2,'2'); +select * from t1 where f1 = 2; +f1 f2 f3 +2 2 2 +drop table t1; --- 1.11/mysql-test/t/partition.test Wed Jan 18 15:09:00 2006 +++ 1.12/mysql-test/t/partition.test Tue Jan 31 18:44:50 2006 @@ -353,3 +353,18 @@ insert into t1 values (10,1); drop table t1; +# +# Bug#16901 Partitions: crash, SELECT, column of part. +# function=first column of primary key +# +create table t1 (f1 integer,f2 integer, f3 varchar(10), primary key(f1,f2)) +partition by range(f1) subpartition by hash(f2) subpartitions 2 +(partition p1 values less than (0), + partition p2 values less than (2), + partition p3 values less than (2147483647)); + +insert into t1 values(10,10,'10'); +insert into t1 values(2,2,'2'); +select * from t1 where f1 = 2; +drop table t1; + --- 1.29/sql/sql_partition.cc Mon Jan 30 20:54:12 2006 +++ 1.30/sql/sql_partition.cc Tue Jan 31 18:44:50 2006 @@ -3750,7 +3750,7 @@ void get_partition_set(const TABLE *tabl subpartitions. This is a range without holes. */ DBUG_ASSERT(sub_part == no_parts); - part_spec->start_part= part_part * part_info->no_parts; + part_spec->start_part= part_part * part_info->no_subparts; part_spec->end_part= part_spec->start_part+part_info->no_subparts - 1; } else