diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-08-22 13:38:32 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-08-22 13:38:32 +0200 |
commit | 5dc1a2231f55bacc9aaf0e24816f3d9c2ee1f21d (patch) | |
tree | 15cc0992060f7813657ae6e47c886ade595da1ff /mysql-test/r | |
parent | aab970f5e16a1dbb308cfc13d47d3b863143811f (diff) | |
download | mariadb-git-5dc1a2231f55bacc9aaf0e24816f3d9c2ee1f21d.tar.gz |
lp:822760 Wrong result with view + invalid dates
sql/sql_select.cc:
items' cmp_type()'s must match, not result_type()'s
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/select.result | 37 | ||||
-rw-r--r-- | mysql-test/r/select_jcl6.result | 37 | ||||
-rw-r--r-- | mysql-test/r/select_pkeycache.result | 37 |
3 files changed, 111 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 9b43533ba77..8f4d5eba1fe 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -5031,3 +5031,40 @@ SELECT * FROM t1 WHERE a = b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 DROP TABLE t1; +# +# lp:822760 Wrong result with view + invalid dates +# +CREATE TABLE t1 (f1 date); +INSERT IGNORE INTO t1 VALUES ('0000-00-00'); +CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1; +SELECT * FROM t1 HAVING f1 = 'zz'; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +SELECT * FROM t1 HAVING f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'aa' +SELECT * FROM t1 HAVING f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +SELECT * FROM t1 WHERE f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Incorrect datetime value: 'zz' +SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +DROP TABLE t1; +DROP VIEW v1; diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index ee18dcfa2c3..28f03867f25 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -5040,6 +5040,43 @@ SELECT * FROM t1 WHERE a = b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 DROP TABLE t1; +# +# lp:822760 Wrong result with view + invalid dates +# +CREATE TABLE t1 (f1 date); +INSERT IGNORE INTO t1 VALUES ('0000-00-00'); +CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1; +SELECT * FROM t1 HAVING f1 = 'zz'; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +SELECT * FROM t1 HAVING f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'aa' +SELECT * FROM t1 HAVING f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +SELECT * FROM t1 WHERE f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Incorrect datetime value: 'zz' +SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +DROP TABLE t1; +DROP VIEW v1; set join_cache_level=default; show variables like 'join_cache_level'; Variable_name Value diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index 9b43533ba77..8f4d5eba1fe 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -5031,3 +5031,40 @@ SELECT * FROM t1 WHERE a = b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 DROP TABLE t1; +# +# lp:822760 Wrong result with view + invalid dates +# +CREATE TABLE t1 (f1 date); +INSERT IGNORE INTO t1 VALUES ('0000-00-00'); +CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1; +SELECT * FROM t1 HAVING f1 = 'zz'; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +SELECT * FROM t1 HAVING f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'aa' +SELECT * FROM t1 HAVING f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +SELECT * FROM t1 WHERE f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +Warning 1292 Incorrect datetime value: 'zz' +SELECT * FROM v1 HAVING f1 = 'zz' AND f1 <= 'aa' ; +f1 +0000-00-00 +Warnings: +Warning 1292 Incorrect datetime value: 'zz' +Warning 1292 Incorrect datetime value: 'aa' +DROP TABLE t1; +DROP VIEW v1; |