summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-vars.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2007-05-04 18:57:10 +0400
committerunknown <evgen@moonbone.local>2007-05-04 18:57:10 +0400
commit99bde6d9ecf76fabfa1460b9780134f40663a11f (patch)
treefbb263973b2c407217562f421ca1423cf5ea650b /mysql-test/r/sp-vars.result
parent8e8ece72eb0530bee9b200d92ba14a143cd1dec9 (diff)
downloadmariadb-git-99bde6d9ecf76fabfa1460b9780134f40663a11f.tar.gz
Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
The LEAST/GREATEST functions compared DATE/DATETIME values as strings which in some cases could lead to a wrong result. A new member function called cmp_datetimes() is added to the Item_func_min_max class. It compares arguments in DATETIME context and returns index of the least/greatest argument. The Item_func_min_max::fix_length_and_dec() function now detects when arguments should be compared in DATETIME context and sets the newly added flag compare_as_dates. It indicates that the cmp_datetimes() function should be called to get a correct result. Item_func_min_max::val_xxx() methods are corrected to call the cmp_datetimes() function when needed. Objects of the Item_splocal class now stores and reports correct original field type. mysql-test/t/type_datetime.test: Added a test case for the bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. mysql-test/r/type_datetime.result: Added a test case for the bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. mysql-test/r/sp-vars.result: A test case result corrected after the fix for the bug#27759. sql/mysql_priv.h: Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. Added the prototype of the get_datetime_value() function. sql/item_func.h: Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. A new member function called cmp_datetimes() is added to the Item_func_min_max class. sql/item_func.cc: Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. A new member function called cmp_datetimes() is added to the Item_func_min_max class. It compares arguments in DATETIME context and returns index of the least/greatest argument. The Item_func_min_max::fix_length_and_dec() function now detects when arguments should be compared in DATETIME context and sets the newly added flag compare_as_dates. It indicates that the cmp_datetimes() function should be called to get a correct result. Item_func_min_max::val_xxx() methods are corrected to call the cmp_datetimes() function when needed. sql/item_cmpfunc.cc: Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. The get_datetime_value() function is no longer static. sql/item.h: Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. Objects of the Item_splocal class now stores and reports correct original field type. sql/item.cc: Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions. Objects of the Item_splocal class now stores and reports correct original field type.
Diffstat (limited to 'mysql-test/r/sp-vars.result')
-rw-r--r--mysql-test/r/sp-vars.result4
1 files changed, 2 insertions, 2 deletions
diff --git a/mysql-test/r/sp-vars.result b/mysql-test/r/sp-vars.result
index 6090dfdf737..b112c6bece6 100644
--- a/mysql-test/r/sp-vars.result
+++ b/mysql-test/r/sp-vars.result
@@ -690,12 +690,12 @@ END|
CALL p1(NOW());
Table Create Table
t1 CREATE TABLE "t1" (
- "x" varbinary(19) default NULL
+ "x" datetime default NULL
)
CALL p1('test');
Table Create Table
t1 CREATE TABLE "t1" (
- "x" varbinary(19) default NULL
+ "x" datetime default NULL
)
Warnings:
Warning 1264 Out of range value adjusted for column 'x' at row 1