summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sergefp@foxhole.(none)>2007-12-13 13:39:37 +0300
committerunknown <sergefp@foxhole.(none)>2007-12-13 13:39:37 +0300
commit196f0c751f9a36b34f0dd5e15df4a9fcd51c0b81 (patch)
tree76aef67ae045193e0a22e882dfcd34f3ecb433a2 /mysql-test
parent1cdd95f7d1a27723c1ae1d3a6f457a0042b44795 (diff)
parentc6675cd1876a90468ca2e2cb10471af93728aa6c (diff)
downloadmariadb-git-196f0c751f9a36b34f0dd5e15df4a9fcd51c0b81.tar.gz
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into mysql.com:/home/psergey/mysql-5.0-bug32198
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/range.result18
-rw-r--r--mysql-test/t/range.test20
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 58f8d077ac5..e0084b53320 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1135,3 +1135,21 @@ item started price
A1 2005-11-01 08:00:00 1000.000
A1 2005-11-15 00:00:00 2000.000
DROP TABLE t1;
+
+BUG#32198 "Comparison of DATE with DATETIME still not using indexes correctly"
+
+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');
+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';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range dateval dateval 4 NULL 2 Using where
+drop table t1;
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