From 6e078ff5433080699416ed473a332395d48a1bfa Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 15 Jul 2007 21:51:36 +0400 Subject: Extended fix for the bug#29555. The get_time_value function is added. It is used to obtain TIME values both from items the can return time as an integer and from items that can return time only as a string. The Arg_comparator::compare_datetime function now uses pointer to a getter function to obtain values to compare. Now this function is also used for comparison of TIME values. The get_value_func variable is added to the Arg_comparator class. It points to a getter function for the DATE/DATETIME/TIME comparator. mysql-test/t/type_time.test: Extended test case for the bug#29555. mysql-test/r/type_time.result: Extended test case for the bug#29555. sql/item_cmpfunc.cc: Extended fix for the bug#29555. The get_time_value function is added. It is used to obtain TIME values both from items the can return time as an integer and from items that can return time only as a string. The Arg_comparator::compare_datetime function now uses pointer to a getter function to obtain values to compare. Now this function is also used for comparison of TIME values. sql/item_cmpfunc.h: Extended fix for the bug#29555. The get_value_func variable is added to the Arg_comparator class. It points to a getter function for the DATE/DATETIME/TIME comparator. --- sql/item_cmpfunc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/item_cmpfunc.h') diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 79091b9c87d..9afc0507817 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -42,6 +42,8 @@ class Arg_comparator: public Sql_alloc bool is_nulls_eq; // TRUE <=> compare for the EQUAL_FUNC enum enum_date_cmp_type { CMP_DATE_DFLT= 0, CMP_DATE_WITH_DATE, CMP_DATE_WITH_STR, CMP_STR_WITH_DATE }; + ulonglong (*get_value_func)(THD *thd, Item ***item_arg, Item **cache_arg, + Item *warn_item, bool *is_null); public: DTCollation cmp_collation; -- cgit v1.2.1