From: Date: December 20 2005 11:11am Subject: bk commit into 5.1 tree (gluh:1.1968) BUG#15393 List-Archive: http://lists.mysql.com/commits/273 X-Bug: 15393 Message-Id: <20051220101107.C8037528925@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.1968 05/12/20 14:10:56 gluh@stripped +3 -0 Fix for bug#15393 range partitioning puts records in the wrong partition break the loop if value of range is equal to result of expression sql/sql_partition.cc 1.17 05/12/20 14:09:22 gluh@stripped +2 -0 Fix for bug#15393 range partitioning puts records in the wrong partition break the loop if value of range is equal to result of expression mysql-test/t/partition_range.test 1.5 05/12/20 14:09:22 gluh@stripped +17 -0 Fix for bug#15393 range partitioning puts records in the wrong partition test case mysql-test/r/partition_range.result 1.5 05/12/20 14:09:22 gluh@stripped +14 -0 Fix for bug#15393 range partitioning puts records in the wrong partition 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.15393 --- 1.4/mysql-test/r/partition_range.result Thu Dec 15 20:56:08 2005 +++ 1.5/mysql-test/r/partition_range.result Tue Dec 20 14:09:22 2005 @@ -337,3 +337,17 @@ a b c 1 1 1 4 1 1 drop table t1; +create table t1 (a varchar(1) default null) +partition by range (case a when 'a' then 1 +when 'b' then 2 +when 'c' then 3 +end) +( partition a VALUES LESS THAN (2), +partition b VALUES LESS THAN (3), +partition c VALUES LESS THAN (4) ); +insert into t1(a) values ('c'); +alter table t1 drop partition b, a; +select count(*) from t1; +count(*) +1 +drop table t1; --- 1.4/mysql-test/t/partition_range.test Thu Dec 15 20:56:08 2005 +++ 1.5/mysql-test/t/partition_range.test Tue Dec 20 14:09:22 2005 @@ -361,3 +361,20 @@ subpartition by hash (a+b) SELECT * from t1; drop table t1; + +# +# Bug#15393 range partitioning puts records in the wrong partition +# +create table t1 (a varchar(1) default null) +partition by range (case a when 'a' then 1 + when 'b' then 2 + when 'c' then 3 + end) +( partition a VALUES LESS THAN (2), + partition b VALUES LESS THAN (3), + partition c VALUES LESS THAN (4) ); + +insert into t1(a) values ('c'); +alter table t1 drop partition b, a; +select count(*) from t1; +drop table t1; --- 1.16/sql/sql_partition.cc Thu Dec 15 15:22:59 2005 +++ 1.17/sql/sql_partition.cc Tue Dec 20 14:09:22 2005 @@ -2499,6 +2499,8 @@ bool get_partition_id_range(partition_in while (max_part_id > min_part_id) { loc_part_id= (max_part_id + min_part_id + 1) >> 1; + if (range_array[loc_part_id] == part_func_value) + break; if (range_array[loc_part_id] < part_func_value) min_part_id= loc_part_id + 1; else