diff options
author | sergefp@mysql.com <> | 2007-12-13 13:38:22 +0300 |
---|---|---|
committer | sergefp@mysql.com <> | 2007-12-13 13:38:22 +0300 |
commit | dd0854db54a0fc9f939d69dd91bd710726e9847f (patch) | |
tree | 8280703de51f1dcb45bd62866b4eca3f9ba5b947 /mysql-test/t/range.test | |
parent | 55d6d04df0e93a446ee592d71689bedb16189478 (diff) | |
download | mariadb-git-dd0854db54a0fc9f939d69dd91bd710726e9847f.tar.gz |
BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
- Make conditions like "date_col $CMP$ 'datetime-const'" range-sargable
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r-- | mysql-test/t/range.test | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index b8d4b91f03d..87ba3510326 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -935,4 +935,24 @@ SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; DROP TABLE t1; +--echo +--echo BUG#32198 "Comparison of DATE with DATETIME still not using indexes correctly" +--echo +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + dateval date default NULL, + PRIMARY KEY (id), + KEY dateval (dateval) +) AUTO_INCREMENT=173; + +INSERT INTO t1 VALUES +(1,'2007-01-01'),(2,'2007-01-02'),(3,'2007-01-03'),(4,'2007-01-04'), +(5,'2007-01-05'),(6,'2007-01-06'),(7,'2007-01-07'),(8,'2007-01-08'), +(9,'2007-01-09'),(10,'2007-01-10'),(11,'2007-01-11'); + +--echo This must use range access: +explain select * from t1 where dateval >= '2007-01-01 00:00:00' and dateval <= '2007-01-02 23:59:59'; + +drop table t1; + # End of 5.0 tests |