diff options
author | Evgeny Potemkin <epotemkin@mysql.com> | 2009-11-17 17:06:46 +0300 |
---|---|---|
committer | Evgeny Potemkin <epotemkin@mysql.com> | 2009-11-17 17:06:46 +0300 |
commit | 726e83907cea41206bb1f4333b55c26f467b90ab (patch) | |
tree | af0ca01e08ac8bd1860a5bab89dcf639b9b84bbd /sql/item_subselect.h | |
parent | 16853758126b26c8707af8c23c40d691989ff7fe (diff) | |
download | mariadb-git-726e83907cea41206bb1f4333b55c26f467b90ab.tar.gz |
Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
MySQL manual describes values of the YEAR(2) field type as follows:
values 00 - 69 mean 2000 - 2069 years and values 70 - 99 mean 1970 - 1999
years. MIN/MAX and comparison functions was comparing them as int values
thus producing wrong result.
Now the Arg_comparator class is extended with compare_year function which
performs correct comparison of the YEAR type.
The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
correctly calculate its value.
To allow Arg_comparator to use func_name() function for Item_func and Item_sum
objects the func_name declaration is moved to the Item_result_field class.
A helper function is_owner_equal_func is added to the Arg_comparator class.
It checks whether the Arg_comparator object owner is the <=> function or not.
A helper function setup is added to the Item_sum_hybrid class. It sets up
cache item and comparator.
Diffstat (limited to 'sql/item_subselect.h')
-rw-r--r-- | sql/item_subselect.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_subselect.h b/sql/item_subselect.h index d4aa621c083..467e9b22637 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -132,6 +132,7 @@ public: @return the SELECT_LEX structure associated with this Item */ st_select_lex* get_select_lex(); + const char *func_name() const { DBUG_ASSERT(0); return "subselect"; } friend class select_subselect; friend class Item_in_optimizer; |