Loading mysql-test/r/partition_pruning.result +14 −0 Original line number Diff line number Diff line Loading @@ -583,3 +583,17 @@ explain partitions select * from t1 where a>='a' and a <= 'dddd'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where drop table t1; create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2))) subpartition by hash(f_int1) subpartitions 2 ( partition part1 values in (0), partition part2 values in (1), partition part4 values in (null) ); insert into t1 set f_int1 = null; select * from t1 where f_int1 is null; f_int1 NULL explain partitions select * from t1 where f_int1 is null; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part4_p2sp0 system NULL NULL NULL NULL 1 mysql-test/t/partition_pruning.test +14 −0 Original line number Diff line number Diff line Loading @@ -479,5 +479,19 @@ select * from t1 where a>='a' and a <= 'dddd'; explain partitions select * from t1 where a>='a' and a <= 'dddd'; drop table t1; # BUG#18659: Assertion failure when subpartitioning is used and partition is # "IS NULL" create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2))) subpartition by hash(f_int1) subpartitions 2 ( partition part1 values in (0), partition part2 values in (1), partition part4 values in (null) ); insert into t1 set f_int1 = null; select * from t1 where f_int1 is null; explain partitions select * from t1 where f_int1 is null; # No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447 # being fixed. sql/sql_partition.cc +5 −1 Original line number Diff line number Diff line Loading @@ -5521,7 +5521,11 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info, else { longlong dummy; if (!part_info->get_partition_id(part_info, &part_id, &dummy)) int res= part_info->is_sub_partitioned() ? part_info->get_part_partition_id(part_info, &part_id, &dummy): part_info->get_partition_id(part_info, &part_id, &dummy); if (!res) { init_single_partition_iterator(part_id, part_iter); return 1; /* Ok, iterator initialized */ Loading Loading
mysql-test/r/partition_pruning.result +14 −0 Original line number Diff line number Diff line Loading @@ -583,3 +583,17 @@ explain partitions select * from t1 where a>='a' and a <= 'dddd'; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2,p3,p4,p5 ALL NULL NULL NULL NULL 5 Using where drop table t1; create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2))) subpartition by hash(f_int1) subpartitions 2 ( partition part1 values in (0), partition part2 values in (1), partition part4 values in (null) ); insert into t1 set f_int1 = null; select * from t1 where f_int1 is null; f_int1 NULL explain partitions select * from t1 where f_int1 is null; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 part4_p2sp0 system NULL NULL NULL NULL 1
mysql-test/t/partition_pruning.test +14 −0 Original line number Diff line number Diff line Loading @@ -479,5 +479,19 @@ select * from t1 where a>='a' and a <= 'dddd'; explain partitions select * from t1 where a>='a' and a <= 'dddd'; drop table t1; # BUG#18659: Assertion failure when subpartitioning is used and partition is # "IS NULL" create table t1 (f_int1 integer) partition by list(abs(mod(f_int1,2))) subpartition by hash(f_int1) subpartitions 2 ( partition part1 values in (0), partition part2 values in (1), partition part4 values in (null) ); insert into t1 set f_int1 = null; select * from t1 where f_int1 is null; explain partitions select * from t1 where f_int1 is null; # No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447 # being fixed.
sql/sql_partition.cc +5 −1 Original line number Diff line number Diff line Loading @@ -5521,7 +5521,11 @@ int get_part_iter_for_interval_via_walking(partition_info *part_info, else { longlong dummy; if (!part_info->get_partition_id(part_info, &part_id, &dummy)) int res= part_info->is_sub_partitioned() ? part_info->get_part_partition_id(part_info, &part_id, &dummy): part_info->get_partition_id(part_info, &part_id, &dummy); if (!res) { init_single_partition_iterator(part_id, part_iter); return 1; /* Ok, iterator initialized */ Loading