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.
Showing
Please register or sign in to comment