diff options
author | unknown <sergefp@mysql.com> | 2005-12-26 08:40:09 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-12-26 08:40:09 +0300 |
commit | a4a1bb0e2f599992c2e12b3a53b46b4ae9b56423 (patch) | |
tree | 0a1413816e31d28107e8a9a5f46033b1c7c38ba1 /mysql-test/t/partition_pruning.test | |
parent | f19fb8709c8cb296c4aa60d0cdd4beb5f4f3cad1 (diff) | |
download | mariadb-git-a4a1bb0e2f599992c2e12b3a53b46b4ae9b56423.tar.gz |
WL#2985 "Partition Pruning": post-review fixes:
- Added more comments.
- Added a RANGE_OPT_PARAM::remove_jump_scans flag that disables construction of index_merge
SEL_TREEs that represent unusable conditions like "key1part1<c1 OR key2part2<c2"
- make prune_partitions() function handle the case where range analysis produces a list of
index_merge trees (it turned out that this is possible, appropriate test case added).
- Other small fixes.
mysql-test/r/partition_pruning.result:
WL#2985 "Partition Pruning": post-review fixes: more test cases
mysql-test/t/partition_pruning.test:
WL#2985 "Partition Pruning": post-review fixes: more test cases
sql/opt_range.cc:
WL#2985 "Partition Pruning": post-review fixes:
- Added more comments.
- Fix the debug printouts
- Added a RANGE_OPT_PARAM::remove_jump_scans flag that disables construction of index_merge
SEL_TREEs that represent unusable conditions like "key1part1<c1 OR key2part2<c2"
- make prune_partitions() function handle the case where range analysis produces a list of
index_merge trees (it turned out that this is possible, appropriate test case added).
sql/sql_partition.cc:
WL#2985 "Partition Pruning": post-review fixes: make requested edits in comments.
sql/table.h:
WL#2985 "Partition Pruning": post-review fixes: added bool TABLE::no_partitions_used
(this change was missed when making the original cset)
Diffstat (limited to 'mysql-test/t/partition_pruning.test')
-rw-r--r-- | mysql-test/t/partition_pruning.test | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index e496a1b8e12..876efbea00b 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -192,4 +192,46 @@ insert into t1 values ('a'),('b'),('c'); explain partitions select * from t1 where a='b'; drop table t1; +# +# Test cases for bugs found in code review: +# +create table t1 ( + a1 int not null +) +partition by range (a1) ( + partition p0 values less than (3), + partition p1 values less than (6), + partition p2 values less than (9) +); +insert into t1 values (1),(2),(3); +explain partitions select * from t1 where a1 > 3; +explain partitions select * from t1 where a1 >= 3; + +explain partitions select * from t1 where a1 < 3 and a1 > 3; +drop table t1; + +# +create table t3 (a int, b int) + partition by list(a) subpartition by hash(b) subpartitions 4 ( + partition p0 values in (1), + partition p1 values in (2), + partition p2 values in (3), + partition p3 values in (4) + ); +insert into t3 values (1,1),(2,2),(3,3); + +explain partitions select * from t3 where a=2 or b=1; +explain partitions select * from t3 where a=4 or b=2; +explain partitions select * from t3 where (a=2 or b=1) and (a=4 or b=2) ; + +# Test for NULLs +create table t1 (a int) partition by hash(a) partitions 2; +insert into t1 values (1),(2); +explain partitions select * from t1 where a is null; + +# this selects both +explain partitions select * from t1 where a is not null; +drop table t1; +# No tests for NULLs in RANGE(monotonic_expr()) - they depend on BUG#15447 +# being fixed. |