diff options
author | unknown <igor@rurik.mysql.com> | 2006-08-31 07:27:34 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2006-08-31 07:27:34 -0700 |
commit | c4c36e17ac4b4dc7c80de3b6afe9aa92951bf7b5 (patch) | |
tree | 57d06c34afcf4e450d638e81495fde5baa834996 /mysql-test/t/range.test | |
parent | 75865af64bdabcf0ade933de1e482a5bea0fb6e9 (diff) | |
download | mariadb-git-c4c36e17ac4b4dc7c80de3b6afe9aa92951bf7b5.tar.gz |
Fixed bug #16249: different results for a range with an without index
when a range condition use an invalid DATETIME constant.
Now we do not use invalid DATETIME constants to form end keys for
range intervals: range analysis just ignores predicates with such
constants.
mysql-test/r/query_cache.result:
Adjusted result warnings when adding a fix for bug #16249.
mysql-test/r/range.result:
Added a test case for bug #16249.
mysql-test/t/range.test:
Added a test case for bug #16249.
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r-- | mysql-test/t/range.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 776c1a466ca..240851e6ac4 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -709,5 +709,34 @@ EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c; DROP TABLE t1; +# +# Bug #16249: different results for a range with an without index +# when a range condition use an invalid datetime constant +# + +CREATE TABLE t1 ( + item char(20) NOT NULL default '', + started datetime NOT NULL default '0000-00-00 00:00:00', + price decimal(16,3) NOT NULL default '0.000', + PRIMARY KEY (item,started) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES +('A1','2005-11-01 08:00:00',1000), +('A1','2005-11-15 00:00:00',2000), +('A1','2005-12-12 08:00:00',3000), +('A2','2005-12-01 08:00:00',1000); + +EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; +SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; +SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; + +DROP INDEX `PRIMARY` ON t1; + +EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; +SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; +SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00'; + +DROP TABLE t1; # End of 5.0 tests |