mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-10763: Wrong result - server does not return NULL values from default list partition after ALTER table
Fixed partition pruning for NULL value.
This commit is contained in:
@ -1204,3 +1204,32 @@ where a>=10 and (a <=10 and b <=30);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1,p2,p3 ALL NULL NULL NULL NULL 3 Using where
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-10763: Wrong result - server does not return NULL values
|
||||
# from default list partition after ALTER table
|
||||
#
|
||||
create table t1 (i int) partition by list (i) ( partition p1 default);
|
||||
insert into t1 values (null);
|
||||
select * from t1 where i is null;
|
||||
i
|
||||
NULL
|
||||
alter table t1 partition by list (i) ( partition p1 values in (1), partition p2 default);
|
||||
select * from t1 where i is null;
|
||||
i
|
||||
NULL
|
||||
explain partitions
|
||||
select * from t1 where i is null;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2 system NULL NULL NULL NULL 1
|
||||
alter table t1 partition by list (i) (
|
||||
partition p0 values in (NULL),
|
||||
partition p1 values in (1),
|
||||
partition p2 default);
|
||||
select * from t1 where i is null;
|
||||
i
|
||||
NULL
|
||||
explain partitions
|
||||
select * from t1 where i is null;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user