summaryrefslogtreecommitdiff
path: root/mysql-test/r/parser.result
diff options
context:
space:
mode:
authorEvgeny Potemkin <epotemkin@mysql.com>2010-09-07 10:45:00 +0400
committerEvgeny Potemkin <epotemkin@mysql.com>2010-09-07 10:45:00 +0400
commit34c510d6beb69c5d8cdac1f9017f1eae1a1f02d1 (patch)
tree96106828d55035ce9e9a139aff4470fbd9821070 /mysql-test/r/parser.result
parent6fa0df0fc71abc4dd860aa6ede492e609858daaf (diff)
downloadmariadb-git-34c510d6beb69c5d8cdac1f9017f1eae1a1f02d1.tar.gz
Bug#56271: Wrong comparison result with STR_TO_DATE function
The Item_func_str_to_date class wasn't providing correct integer DATETIME representation as expected. This led to wrong comparison result and didn't allowed the STR_TO_DATE function to be used with indexes. Also, STR_TO_DATE function was inconsisted on throwing warnings/errors. Fixed now. val_int and result_as_longlong methods were added to the Item_func_str_to_date class. mysql-test/r/func_time.result: Test case result adjusted after fixing bug#56271. mysql-test/r/parser.result: Test case result adjusted after fixing bug#56271. mysql-test/r/select.result: A test case result adjusted after fixing bug#56271. mysql-test/r/strict.result: Test case result adjusted after fixing bug#56271. mysql-test/r/type_datetime.result: Added a test case for the bug#56271. mysql-test/t/strict.test: Test case adjusted after fixing bug#56271. mysql-test/t/type_datetime.test: Added a test case for the bug#56271. sql/item_timefunc.cc: Bug#56271: Wrong comparison result with STR_TO_DATE function val_int and result_as_longlong methods were added to the Item_func_str_to_date class. Item_func_str_to_date::get_date now throws the ER_WRONG_VALUE_FOR_TYPE warning on incorrect value. sql/item_timefunc.h: Bug#56271: Wrong comparison result with STR_TO_DATE function val_int and result_as_longlong methods were added to the Item_func_str_to_date class.
Diffstat (limited to 'mysql-test/r/parser.result')
-rw-r--r--mysql-test/r/parser.result4
1 files changed, 4 insertions, 0 deletions
diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result
index 467bb7c5cb8..1ea9e91df8a 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -556,9 +556,13 @@ DROP TABLE IF EXISTS t1;
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE;
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL 10 MINUTE
NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
SELECT STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE;
STR_TO_DATE('10:00 PM', '%h:%i %p') + INTERVAL (INTERVAL(1,2,3) + 1) MINUTE
NULL
+Warnings:
+Warning 1411 Incorrect datetime value: '10:00 PM' for function str_to_date
SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
"1997-12-31 23:59:59" + INTERVAL 1 SECOND
1998-01-01 00:00:00