diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2016-09-08 19:43:09 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2016-09-09 13:50:17 +0200 |
commit | b22ed66c6b479355b97f59bbf2aadc23f4005419 (patch) | |
tree | 58f579f3584ef91f1f651c360ba0acba0870ea5d /mysql-test | |
parent | 2c52493d140d96d0a1bfd442aa569d2690a22a59 (diff) | |
download | mariadb-git-b22ed66c6b479355b97f59bbf2aadc23f4005419.tar.gz |
MDEV-10765: Wrong result - query does not retrieve values from default partition on a table partitioned by list columns
Partial matches should be treat as not exact one.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/partition_default.result | 55 | ||||
-rw-r--r-- | mysql-test/t/partition_default.test | 47 |
2 files changed, 102 insertions, 0 deletions
diff --git a/mysql-test/r/partition_default.result b/mysql-test/r/partition_default.result index ab9fa58a222..4d9984126b5 100644 --- a/mysql-test/r/partition_default.result +++ b/mysql-test/r/partition_default.result @@ -1149,3 +1149,58 @@ t1 CREATE TABLE `t1` ( PARTITION p2 VALUES IN ((1,4),(2,5),(3,6)) ENGINE = MyISAM, PARTITION p1 VALUES IN ((1,1),(0,0)) ENGINE = MyISAM) */ drop table t1; +# +# MDEV-10765: Wrong result - query does not retrieve values from +# default partition on a table partitioned by list columns +# +create table t1 (i int, j int) partition by list columns(i,j) (partition p1 values in ((10,10)), partition p2 default); +insert into t1 values (10,1); +select * from t1 where i = 10; +i j +10 1 +explain partitions +select * from t1 where i = 10; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1,p2 system NULL NULL NULL NULL 1 +select * from t1 where i = 10 and j=1; +i j +10 1 +explain partitions +select * from t1 where i = 10 and j=1; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p2 system NULL NULL NULL NULL 1 +insert into t1 values (10,10); +select * from t1 where i = 10 and j=10; +i j +10 10 +explain partitions +select * from t1 where i = 10 and j=10; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 system NULL NULL NULL NULL 1 +drop table t1; +create table t1 +( +a int not null, +b int not null, +c int +) +partition by list columns(a,b) +( +partition p1 values in ((10,10)), +partition p2 values in ((10,20)), +partition p3 values in ((10,30)), +partition p4 values in ((10,40)), +partition p5 values in ((10,50)) +); +insert into t1 values +(10,10,1234), +(10,20,1234), +(10,30,1234), +(10,40,1234), +(10,50,1234); +explain partitions +select * from t1 +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; diff --git a/mysql-test/t/partition_default.test b/mysql-test/t/partition_default.test index 8f7fe588525..e6eec53761a 100644 --- a/mysql-test/t/partition_default.test +++ b/mysql-test/t/partition_default.test @@ -453,3 +453,50 @@ create table t1 (a int, b int) show create table t1; drop table t1; + +--echo # +--echo # MDEV-10765: Wrong result - query does not retrieve values from +--echo # default partition on a table partitioned by list columns +--echo # + +create table t1 (i int, j int) partition by list columns(i,j) (partition p1 values in ((10,10)), partition p2 default); +insert into t1 values (10,1); +select * from t1 where i = 10; +explain partitions +select * from t1 where i = 10; +select * from t1 where i = 10 and j=1; +explain partitions +select * from t1 where i = 10 and j=1; +insert into t1 values (10,10); +select * from t1 where i = 10 and j=10; +explain partitions +select * from t1 where i = 10 and j=10; +drop table t1; + +create table t1 +( + a int not null, + b int not null, + c int +) +partition by list columns(a,b) +( + partition p1 values in ((10,10)), + partition p2 values in ((10,20)), + partition p3 values in ((10,30)), + partition p4 values in ((10,40)), + partition p5 values in ((10,50)) +); + +insert into t1 values + (10,10,1234), + (10,20,1234), + (10,30,1234), + (10,40,1234), + (10,50,1234); + +explain partitions +select * from t1 +where a>=10 and (a <=10 and b <=30); + +drop table t1; |