mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
BUG20733: Bug in partition pruning with zerofill field
Problem was with handling NULL values in ranges
This commit is contained in:
@@ -9,6 +9,50 @@
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# More checks for partition pruning
|
||||
#
|
||||
create table t1 (a int unsigned)
|
||||
partition by range (a)
|
||||
(partition pnull values less than (0),
|
||||
partition p0 values less than (1),
|
||||
partition p1 values less than(2));
|
||||
insert into t1 values (null),(0),(1);
|
||||
|
||||
select * from t1 where a is null;
|
||||
select * from t1 where a >= 0;
|
||||
select * from t1 where a < 0;
|
||||
select * from t1 where a <= 0;
|
||||
select * from t1 where a > 1;
|
||||
explain partitions select * from t1 where a is null;
|
||||
explain partitions select * from t1 where a >= 0;
|
||||
explain partitions select * from t1 where a < 0;
|
||||
explain partitions select * from t1 where a <= 0;
|
||||
explain partitions select * from t1 where a > 1;
|
||||
drop table t1;
|
||||
|
||||
create table t1 (a int unsigned, b int unsigned)
|
||||
partition by range (a)
|
||||
subpartition by hash (b)
|
||||
subpartitions 2
|
||||
(partition pnull values less than (0),
|
||||
partition p0 values less than (1),
|
||||
partition p1 values less than(2));
|
||||
insert into t1 values (null,0),(null,1),(0,0),(0,1),(1,0),(1,1);
|
||||
|
||||
select * from t1 where a is null;
|
||||
select * from t1 where a >= 0;
|
||||
select * from t1 where a < 0;
|
||||
select * from t1 where a <= 0;
|
||||
select * from t1 where a > 1;
|
||||
explain partitions select * from t1 where a is null;
|
||||
explain partitions select * from t1 where a >= 0;
|
||||
explain partitions select * from t1 where a < 0;
|
||||
explain partitions select * from t1 where a <= 0;
|
||||
explain partitions select * from t1 where a > 1;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Partition by range, basic
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user