From d53906e3872016cb06f48a80557fb8edda59b691 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Wed, 16 Mar 2011 11:59:01 +0100 Subject: Bug#11746819: Bug#28928: UNIX_TIMESTAMP() should be considered unary monotonic by partition pruning Made UNIX_TIMESTAMP MONOTONIC_INCREASING when it have TIMESTAMP argument (only). --- mysql-test/t/partition.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t/partition.test') diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 0151820cef9..0630dd31714 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -112,10 +112,16 @@ INSERT INTO t1 VALUES ('2009-07-14 17:35:55', 'pmax'); INSERT INTO t1 VALUES ('2009-09-21 17:31:42', 'pmax'); SELECT * FROM t1; +SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01'; +EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01'; +EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48'; ALTER TABLE t1 REORGANIZE PARTITION pmax INTO ( PARTITION p3 VALUES LESS THAN (1247688000), PARTITION pmax VALUES LESS THAN MAXVALUE); SELECT * FROM t1; +SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01'; +EXPLAIN PARTITIONS SELECT * FROM t1 where a between '2007-01-01' and '2007-08-01'; +EXPLAIN PARTITIONS SELECT * FROM t1 where a = '2007-07-30 17:35:48'; SHOW CREATE TABLE t1; DROP TABLE t1; -- cgit v1.2.1