summaryrefslogtreecommitdiff
path: root/mysql-test/r/compare.result
diff options
context:
space:
mode:
authorGeorgi Kodinov <kgeorge@mysql.com>2008-09-18 15:55:36 +0300
committerGeorgi Kodinov <kgeorge@mysql.com>2008-09-18 15:55:36 +0300
commit71fe19017206da71c053cbe794a382eb94f30741 (patch)
tree014cd043662ca96fb1762e01293e3e87ffe7c95f /mysql-test/r/compare.result
parent776793a97c97c4e2b2c7a6a2870696c147eb235c (diff)
downloadmariadb-git-71fe19017206da71c053cbe794a382eb94f30741.tar.gz
Bug #39353: Multiple conditions on timestamp column crashes server
The fix for bug 31887 was incomplete : it assumes that all the field types returned by the IS_NUM macro are descendants of Item_num and tries to zero-fill the values before doing constant substitution with such fields when they are compared to constant string values. The only exception to this is Field_timestamp : it's in the IS_NUM macro, but is not a descendant of Field_num. Fixed by excluding timestamp fields (Field_timestamp) when zero-filling when converting the constant to compare with to a string. Note that this will not exclude the timestamp columns from const propagation. mysql-test/r/compare.result: Bug #39353: test case mysql-test/t/compare.test: Bug #39353: test case sql/item.cc: Bug #39353: don't zero-fill timestamp fields when const propagating to a string : they'll be converted to a string in a date/time format and not as an integer.
Diffstat (limited to 'mysql-test/r/compare.result')
-rw-r--r--mysql-test/r/compare.result5
1 files changed, 5 insertions, 0 deletions
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index c9ef41e0582..748e8a5884b 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -90,4 +90,9 @@ Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t2`.`a` AS `a`,(select count(0) AS `COUNT(*)` from `test`.`t1` where ((`test`.`t1`.`b` = `test`.`t2`.`a`) and (concat(`test`.`t1`.`b`,`test`.`t1`.`c`) = concat(_latin1'0',`test`.`t2`.`a`,_latin1'01')))) AS `x` from `test`.`t2` order by `test`.`t2`.`a`
DROP TABLE t1,t2;
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES (NOW()),(NOW()),(NOW());
+SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
+a
+DROP TABLE t1;
End of 5.0 tests