diff options
author | Alexander Barkov <bar@mariadb.org> | 2018-02-13 20:37:31 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2018-02-13 20:37:31 +0400 |
commit | 95d075a0e5b9b4276c53f888c8090113a8adfbf4 (patch) | |
tree | b43ac5e7c1db879aba5f29c97b70265ae083e124 /sql/item_windowfunc.h | |
parent | 0c4aeef976d1094e90ce7a0b11138916e47c22fc (diff) | |
download | mariadb-git-95d075a0e5b9b4276c53f888c8090113a8adfbf4.tar.gz |
MDEV-15293 CAST(AS TIME) returns bad results for LAST_VALUE(),NAME_CONST(),SP variable
Diffstat (limited to 'sql/item_windowfunc.h')
-rw-r--r-- | sql/item_windowfunc.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h index 9fe95ed6cee..717958d479c 100644 --- a/sql/item_windowfunc.h +++ b/sql/item_windowfunc.h @@ -303,6 +303,7 @@ class Item_sum_hybrid_simple : public Item_sum, my_decimal *val_decimal(my_decimal *); void reset_field(); String *val_str(String *); + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate); const Type_handler *type_handler() const { return Type_handler_hybrid_field_type::type_handler(); } void update_field(); @@ -938,6 +939,29 @@ public: return res; } + bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate) + { + bool res; + if (force_return_blank) + { + null_value= true; + res= true; + } + else if (read_value_from_result_field) + { + if ((null_value= result_field->is_null())) + res= true; + else + res= result_field->get_date(ltime, fuzzydate); + } + else + { + res= window_func()->get_date(ltime, fuzzydate); + null_value= window_func()->null_value; + } + return res; + } + void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, List<Item> &fields, uint flags); |