summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_pruning.test
diff options
context:
space:
mode:
authorsergefp@mysql.com <>2006-01-04 11:09:01 +0300
committersergefp@mysql.com <>2006-01-04 11:09:01 +0300
commit93669bfe0bce493f02226c8c5b0fab3e1c8c3270 (patch)
tree4ea8a914fa12cca3d8ad46e0c42492a7b099eebc /mysql-test/t/partition_pruning.test
parentf2d603c245f623019efe7badcfeae2927f56414a (diff)
downloadmariadb-git-93669bfe0bce493f02226c8c5b0fab3e1c8c3270.tar.gz
WL#2985 "Partition Pruning":
- post-...-post review fixes - Added "integer range walking" that allows to do partition pruning for "a <=? t.field <=? b" by finding used partitions for a, a+1, a+2, ..., b-1, b.
Diffstat (limited to 'mysql-test/t/partition_pruning.test')
-rw-r--r--mysql-test/t/partition_pruning.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 0d6bd344159..b45e6cf0d76 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -247,5 +247,28 @@ explain partitions
select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
drop table t1;
+
+# Tests for "short ranges"
+create table t1 (a int) partition by hash(a) partitions 20;
+insert into t1 values (1),(2),(3);
+explain partitions select * from t1 where a > 1 and a < 3;
+explain partitions select * from t1 where a >= 1 and a < 3;
+explain partitions select * from t1 where a > 1 and a <= 3;
+explain partitions select * from t1 where a >= 1 and a <= 3;
+drop table t1;
+
+create table t1 (a int, b int)
+ partition by list(a) subpartition by hash(b) subpartitions 20
+(
+ partition p0 values in (0),
+ partition p1 values in (1),
+ partition p2 values in (2),
+ partition p3 values in (3)
+);
+insert into t1 values (1,1),(2,2),(3,3);
+
+explain partitions select * from t1 where b > 1 and b < 3;
+explain partitions select * from t1 where b > 1 and b < 3 and (a =1 or a =2);
+
# No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447
# being fixed.