diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2010-03-10 12:56:05 +0100 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2010-03-10 12:56:05 +0100 |
commit | f83e302a13cf18903c4c3bf3f9b90c06eadcc0fe (patch) | |
tree | 4a0f89eaf8659b53bd68bdeb3add3518977b2c2c /mysql-test/t/partition_innodb.test | |
parent | 75ac623404f61624d3d57b37021fd079c5d3385e (diff) | |
download | mariadb-git-f83e302a13cf18903c4c3bf3f9b90c06eadcc0fe.tar.gz |
Bug#51830: Incorrect partition pruning on range partition
(regression)
Problem was that partition pruning did not exclude the
last partition if the range was beyond it
(i.e. not using MAXVALUE)
Fix was to not include the last partition if the
partitioning function value was not within the partition
range.
Diffstat (limited to 'mysql-test/t/partition_innodb.test')
-rw-r--r-- | mysql-test/t/partition_innodb.test | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index b7fe4477a13..0eec30b69bf 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -7,6 +7,38 @@ drop table if exists t1; let $MYSQLD_DATADIR= `SELECT @@datadir`; +--echo # +--echo # Bug#51830: Incorrect partition pruning on range partition (regression) +--echo # +CREATE TABLE t1 (a INT NOT NULL) +ENGINE = InnoDB +PARTITION BY RANGE(a) +(PARTITION p10 VALUES LESS THAN (10), + PARTITION p30 VALUES LESS THAN (30), + PARTITION p50 VALUES LESS THAN (50), + PARTITION p70 VALUES LESS THAN (70), + PARTITION p90 VALUES LESS THAN (90)); +INSERT INTO t1 VALUES (10),(30),(50); +INSERT INTO t1 VALUES (70); +INSERT INTO t1 VALUES (80); +INSERT INTO t1 VALUES (89); +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +INSERT INTO t1 VALUES (90); +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +INSERT INTO t1 VALUES (100); +--error ER_NO_PARTITION_FOR_GIVEN_VALUE +insert INTO t1 VALUES (110); +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 90; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 90; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 90; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 89; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 89; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 89; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 100; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 100; +EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > 100; +DROP TABLE t1; + # # Bug#47029: Crash when reorganize partition with subpartition # |