summaryrefslogtreecommitdiff
path: root/mysql-test/r/range.result
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2006-08-31 07:27:34 -0700
committerunknown <igor@rurik.mysql.com>2006-08-31 07:27:34 -0700
commitc4c36e17ac4b4dc7c80de3b6afe9aa92951bf7b5 (patch)
tree57d06c34afcf4e450d638e81495fde5baa834996 /mysql-test/r/range.result
parent75865af64bdabcf0ade933de1e482a5bea0fb6e9 (diff)
downloadmariadb-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/r/range.result')
-rw-r--r--mysql-test/r/range.result45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 5c2c6e7e965..3edf56496fe 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -896,3 +896,48 @@ EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
DROP TABLE t1;
+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';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 2 Using where
+Warnings:
+Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
+Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
+SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
+item started price
+A1 2005-11-01 08:00:00 1000.000
+A1 2005-11-15 00:00:00 2000.000
+Warnings:
+Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
+Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
+SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
+item started price
+A1 2005-11-01 08:00:00 1000.000
+A1 2005-11-15 00:00:00 2000.000
+DROP INDEX `PRIMARY` ON t1;
+EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
+Warnings:
+Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
+SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
+item started price
+A1 2005-11-01 08:00:00 1000.000
+A1 2005-11-15 00:00:00 2000.000
+Warnings:
+Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
+SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
+item started price
+A1 2005-11-01 08:00:00 1000.000
+A1 2005-11-15 00:00:00 2000.000
+DROP TABLE t1;