diff options
author | Igor Babaev <igor@askmonty.org> | 2011-05-27 17:04:29 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-05-27 17:04:29 -0700 |
commit | 42cc59a8c138e9416326b3c4b4f8d64f0bd48728 (patch) | |
tree | 67372882ab626d4c5b36def6d2d880a21e68bb46 /mysql-test/include/icp_tests.inc | |
parent | d86ad1861a57558e63dc68bf372eff6bdb22cb6d (diff) | |
download | mariadb-git-42cc59a8c138e9416326b3c4b4f8d64f0bd48728.tar.gz |
Backported the test case for bug 43618 from mysql code line.
Diffstat (limited to 'mysql-test/include/icp_tests.inc')
-rw-r--r-- | mysql-test/include/icp_tests.inc | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc index af52e7f30d4..4b28faa8e41 100644 --- a/mysql-test/include/icp_tests.inc +++ b/mysql-test/include/icp_tests.inc @@ -139,6 +139,47 @@ ORDER BY c2 DESC LIMIT 2; DROP TABLE t1; --echo # +--echo # BUG#43618: MyISAM&Maria returns wrong results with 'between' +--echo # on timestamp +--echo # + +CREATE TABLE t1( + ts TIMESTAMP NOT NULL, + c char NULL, + PRIMARY KEY(ts) +); + +INSERT INTO t1 VALUES + ('1971-01-01','a'), + ('2007-05-25','b'), + ('2008-01-01','c'), + ('2038-01-09','d'); + +--disable_warnings + +--echo +--echo # Execute select with invalid timestamp, desc ordering +SELECT * +FROM t1 +WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' +ORDER BY ts DESC +LIMIT 2; + +--echo +--echo # Should use index condition +EXPLAIN +SELECT * +FROM t1 +WHERE ts BETWEEN '0000-00-00' AND '2010-00-01 00:00:00' +ORDER BY ts DESC +LIMIT 2; +--echo + +--enable_warnings + +DROP TABLE t1; + +--echo # --echo # BUG#49906: Assertion failed - Field_varstring::val_str in field.cc --echo # (Note: Fixed by patch for LP BUG#625841) --echo # |