diff options
author | mikael/pappa@dator5.(none) <> | 2006-08-05 16:12:24 -0400 |
---|---|---|
committer | mikael/pappa@dator5.(none) <> | 2006-08-05 16:12:24 -0400 |
commit | db2c48b08d6487df21fe38cd75bcb9426315fb2b (patch) | |
tree | a59f5d5184093db3bb05644321a5bdb8a6ea43d1 /mysql-test | |
parent | a4eb61b88cbe4e8f6e43db2ca841fa60ec73467c (diff) | |
download | mariadb-git-db2c48b08d6487df21fe38cd75bcb9426315fb2b.tar.gz |
BUG#21339: Crash at EXPLAIN PARTITIONS
Caused by missing check for end of partitions in prune range check
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/partition.result | 28 | ||||
-rw-r--r-- | mysql-test/r/partition_range.result | 10 | ||||
-rw-r--r-- | mysql-test/t/partition.test | 18 | ||||
-rw-r--r-- | mysql-test/t/partition_range.test | 13 |
4 files changed, 69 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index e95489864f7..6f72068c0b7 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1117,4 +1117,32 @@ hello/master-data/tmpinx/t1#P#p1#SP#subpart11.MYI hello/master-data/tmpinx/t1#P#p2#SP#subpart20.MYI hello/master-data/tmpinx/t1#P#p2#SP#subpart21.MYI drop table t1; +create table t1 (a bigint unsigned not null, primary key(a)) +engine = myisam +partition by key (a) +partitions 10; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) unsigned NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */ +insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), +(18446744073709551613), (18446744073709551612); +select * from t1; +a +18446744073709551612 +18446744073709551613 +18446744073709551614 +18446744073709551615 +select * from t1 where a = 18446744073709551615; +a +18446744073709551615 +delete from t1 where a = 18446744073709551615; +select * from t1; +a +18446744073709551612 +18446744073709551613 +18446744073709551614 +drop table t1; End of 5.1 tests diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index 9812c80040b..be88d9f6639 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -1,4 +1,14 @@ drop table if exists t1; +create table t1 (a date) +engine = innodb +partition by range (year(a)) +(partition p0 values less than (2006), +partition p1 values less than (2007)); +explain partitions select * from t1 +where a between '2006-01-01' and '2007-06-01'; +id select_type table partitions type possible_keys key key_len ref rows Extra +1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where +drop table t1; create table t1 (a int unsigned) partition by range (a) (partition pnull values less than (0), diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index d4e930f91ec..6e6e4cb304d 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1300,4 +1300,22 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO drop table t1; --exec rmdir $MYSQLTEST_VARDIR/master-data/tmpdata || true --exec rmdir $MYSQLTEST_VARDIR/master-data/tmpinx || true + +# +# Bug 21388: Bigint fails to find record +# +create table t1 (a bigint unsigned not null, primary key(a)) +engine = myisam +partition by key (a) +partitions 10; + +show create table t1; +insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), +(18446744073709551613), (18446744073709551612); +select * from t1; +select * from t1 where a = 18446744073709551615; +delete from t1 where a = 18446744073709551615; +select * from t1; +drop table t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 670b9333ab9..8719cbd98c4 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -10,6 +10,18 @@ drop table if exists t1; --enable_warnings # +# Bug 21339: Crash in Explain Partitions +# +create table t1 (a date) +engine = innodb +partition by range (year(a)) +(partition p0 values less than (2006), + partition p1 values less than (2007)); +explain partitions select * from t1 +where a between '2006-01-01' and '2007-06-01'; +drop table t1; + +# # More checks for partition pruning # create table t1 (a int unsigned) @@ -686,3 +698,4 @@ EXPLAIN PARTITIONS SELECT * from t1 WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR (a >= '2005-07-01' AND a <= '2005-09-30'); DROP TABLE t1; + |