mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG20733: Bug in partition pruning with zerofill field
Problem was with handling NULL values in ranges mysql-test/r/partition_hash.result: New partition pruning test cases mysql-test/r/partition_list.result: New partition pruning test cases mysql-test/r/partition_pruning.result: New partition pruning test cases mysql-test/r/partition_range.result: New partition pruning test cases mysql-test/t/partition_hash.test: New partition pruning test cases mysql-test/t/partition_list.test: New partition pruning test cases mysql-test/t/partition_pruning.test: New partition pruning test cases mysql-test/t/partition_range.test: New partition pruning test cases sql/opt_range.cc: Added comment sql/sql_partition.cc: Partition pruning didn't handle ranges with NULL values in a proper manner
This commit is contained in:
@ -149,6 +149,48 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
explain partitions select * from t6 where a > 3 and a < 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
drop table t6;
|
||||
create table t6 (a int unsigned not null) partition by LIST(a) (
|
||||
partition p1 values in (1),
|
||||
partition p3 values in (3),
|
||||
partition p5 values in (5),
|
||||
partition p7 values in (7),
|
||||
partition p9 values in (9)
|
||||
);
|
||||
insert into t6 values (1),(3),(5);
|
||||
explain partitions select * from t6 where a < 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t6 where a <= 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t6 p1 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t6 where a > 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t6 where a >= 9;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t6 where a > 0 and a < 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t6 p1,p3 ALL NULL NULL NULL NULL 2 Using where
|
||||
explain partitions select * from t6 where a > 5 and a < 12;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t6 where a > 3 and a < 8 ;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t6 p5,p7 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t6 where a >= 0 and a <= 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t6 p1,p3,p5 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t6 where a >= 5 and a <= 12;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t6 p5,p7,p9 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t6 where a >= 3 and a <= 8;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t6 p3,p5,p7 ALL NULL NULL NULL NULL 2 Using where
|
||||
explain partitions select * from t6 where a > 3 and a < 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
create table t7 (a int not null) partition by RANGE(a) (
|
||||
partition p10 values less than (10),
|
||||
partition p30 values less than (30),
|
||||
@ -184,6 +226,42 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
explain partitions select * from t7 where a > 11 and a < 29;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
drop table t7;
|
||||
create table t7 (a int unsigned not null) partition by RANGE(a) (
|
||||
partition p10 values less than (10),
|
||||
partition p30 values less than (30),
|
||||
partition p50 values less than (50),
|
||||
partition p70 values less than (70),
|
||||
partition p90 values less than (90)
|
||||
);
|
||||
insert into t7 values (10),(30),(50);
|
||||
explain partitions select * from t7 where a < 5;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a < 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a <= 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t7 where a = 10;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p30 system NULL NULL NULL NULL 1
|
||||
explain partitions select * from t7 where a < 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t7 p10,p30,p50,p70,p90 ALL NULL NULL NULL NULL 3 Using where
|
||||
explain partitions select * from t7 where a = 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a >= 90;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
explain partitions select * from t7 where a > 11 and a < 29;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
create table t8 (a date not null) partition by RANGE(YEAR(a)) (
|
||||
partition p0 values less than (1980),
|
||||
partition p1 values less than (1990),
|
||||
|
Reference in New Issue
Block a user