diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-03-12 20:13:36 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-03-14 12:40:00 +0100 |
commit | 622115ee07f8e7878389d22b2d624c13a2eda7da (patch) | |
tree | 3fafdd8e0df9f1ae1a4043088616b9ebe5ece93a /sql/item.h | |
parent | 24d6cd7d62c10a6a17be9f4fac1a112f16f8b6e8 (diff) | |
download | mariadb-git-622115ee07f8e7878389d22b2d624c13a2eda7da.tar.gz |
cleanup: extend Item_cache::get_cache() to accept f_type
Do not assume that it's always item->field_type() - this is not the case
in temporal comparisons (e.g. when comparing DATETIME column with a TIME
literal).
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/item.h b/sql/item.h index ed00522fa53..8921ee76f6a 100644 --- a/sql/item.h +++ b/sql/item.h @@ -5551,8 +5551,17 @@ public: enum Item_result cmp_type () const { return Type_handler_hybrid_field_type::cmp_type(); } - static Item_cache* get_cache(THD *thd, const Item *item); - static Item_cache* get_cache(THD *thd, const Item* item, const Item_result type); + static Item_cache* get_cache(THD *thd, const Item* item, + const Item_result type, const enum_field_types f_type); + static Item_cache* get_cache(THD *thd, const Item* item, + const Item_result type) + { + return get_cache(thd, item, type, item->field_type()); + } + static Item_cache* get_cache(THD *thd, const Item *item) + { + return get_cache(thd, item, item->cmp_type()); + } virtual void keep_array() {} virtual void print(String *str, enum_query_type query_type); bool eq_def(const Field *field) |