#At file:///home/mikael/mysql_clones/mysql-trunk-wl3352/
2883 Mikael Ronstrom 2009-10-02
BUG#47754, used number of parts instead of number of list values as end part for list partitioning in column list partitioning
modified:
mysql-test/r/partition_column.result
mysql-test/t/partition_column.test
sql/sql_partition.cc
=== modified file 'mysql-test/r/partition_column.result'
--- a/mysql-test/r/partition_column.result 2009-10-01 14:50:11 +0000
+++ b/mysql-test/r/partition_column.result 2009-10-02 09:31:05 +0000
@@ -20,6 +20,15 @@ select * from t1 where a = 2;
a b
2 NULL
2 2
+select * from t1 where a > 8;
+a b
+select * from t1 where a not between 8 and 8;
+a b
+2 NULL
+2 2
+3 NULL
+1 NULL
+1 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
=== modified file 'mysql-test/t/partition_column.test'
--- a/mysql-test/t/partition_column.test 2009-10-01 14:50:11 +0000
+++ b/mysql-test/t/partition_column.test 2009-10-02 09:31:05 +0000
@@ -14,6 +14,9 @@ partition by list column_list(a,b)
column_list(NULL, NULL)),
partition p1 values in (column_list(1,1), column_list(2,2)),
partition p2 values in (column_list(3, NULL), column_list(NULL, 1)));
+#
+# BUG#47754 Crash when selecting using NOT BETWEEN for column list partitioning
+#
insert into t1 values (3, NULL);
insert into t1 values (NULL, 1);
insert into t1 values (NULL, NULL);
@@ -23,6 +26,8 @@ insert into t1 values (1,1);
insert into t1 values (2,2);
select * from t1 where a = 1;
select * from t1 where a = 2;
+select * from t1 where a > 8;
+select * from t1 where a not between 8 and 8;
show create table t1;
drop table t1;
=== modified file 'sql/sql_partition.cc'
--- a/sql/sql_partition.cc 2009-10-01 13:09:20 +0000
+++ b/sql/sql_partition.cc 2009-10-02 09:31:05 +0000
@@ -6962,7 +6962,15 @@ int get_part_iter_for_interval_cols_via_
nparts);
}
if (flags & NO_MAX_RANGE)
- part_iter->part_nums.end= part_info->num_parts;
+ {
+ if (part_info->part_type == RANGE_PARTITION)
+ part_iter->part_nums.end= part_info->num_parts;
+ else /* LIST_PARTITION */
+ {
+ DBUG_ASSERT(part_info->part_type == LIST_PARTITION);
+ part_iter->part_nums.end= part_info->num_list_values;
+ }
+ }
else
{
// Copy from max_value to record
| Thread |
|---|
| • bzr commit into mysql-5.4 branch (mikael:2883) Bug#47754 | Mikael Ronstrom | 2 Oct |