summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_hash.test
diff options
context:
space:
mode:
authorunknown <mikael/pappa@dator5.(none)>2006-07-20 05:28:16 -0400
committerunknown <mikael/pappa@dator5.(none)>2006-07-20 05:28:16 -0400
commitd3b743ae18801473af91d13a83297bcc0b02fae0 (patch)
treeda310fc6f8a67bd811c883d600b16277eb1c9f3c /mysql-test/t/partition_hash.test
parent98a63cde87b4fc4fced22b12d3a0651afec9a133 (diff)
downloadmariadb-git-d3b743ae18801473af91d13a83297bcc0b02fae0.tar.gz
BUG20733: Bug in partition pruning with zerofill field
Problem was with handling NULL values in ranges mysql-test/r/partition_hash.result: New partition pruning test cases mysql-test/r/partition_list.result: New partition pruning test cases mysql-test/r/partition_pruning.result: New partition pruning test cases mysql-test/r/partition_range.result: New partition pruning test cases mysql-test/t/partition_hash.test: New partition pruning test cases mysql-test/t/partition_list.test: New partition pruning test cases mysql-test/t/partition_pruning.test: New partition pruning test cases mysql-test/t/partition_range.test: New partition pruning test cases sql/opt_range.cc: Added comment sql/sql_partition.cc: Partition pruning didn't handle ranges with NULL values in a proper manner
Diffstat (limited to 'mysql-test/t/partition_hash.test')
-rw-r--r--mysql-test/t/partition_hash.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/partition_hash.test b/mysql-test/t/partition_hash.test
index 8494de98371..3304f30fb1a 100644
--- a/mysql-test/t/partition_hash.test
+++ b/mysql-test/t/partition_hash.test
@@ -10,6 +10,36 @@ drop table if exists t1;
--enable_warnings
#
+# More partition pruning tests, especially on interval walking
+#
+create table t1 (a int unsigned)
+partition by hash(a div 2)
+partitions 4;
+insert into t1 values (null),(0),(1),(2),(3),(4),(5),(6),(7);
+select * from t1 where a < 0;
+select * from t1 where a is null or (a >= 5 and a <= 7);
+select * from t1 where a is null;
+select * from t1 where a is not null;
+select * from t1 where a >= 1 and a < 3;
+select * from t1 where a >= 3 and a <= 5;
+select * from t1 where a > 2 and a < 4;
+select * from t1 where a > 3 and a <= 6;
+select * from t1 where a > 5;
+select * from t1 where a >= 1 and a <= 5;
+explain partitions select * from t1 where a < 0;
+explain partitions select * from t1 where a is null or (a >= 5 and a <= 7);
+explain partitions select * from t1 where a is null;
+explain partitions select * from t1 where a is not null;
+explain partitions select * from t1 where a >= 1 and a < 3;
+explain partitions select * from t1 where a >= 3 and a <= 5;
+explain partitions select * from t1 where a > 2 and a < 4;
+explain partitions select * from t1 where a > 3 and a <= 6;
+explain partitions select * from t1 where a > 5;
+explain partitions select * from t1 where a >= 1 and a <= 5;
+
+drop table t1;
+
+#
# Partition by hash, basic
#
CREATE TABLE t1 (