diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-01-24 16:50:39 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-01-24 16:50:39 +0400 |
commit | d106dc059746157239d951551093fec049a7b73a (patch) | |
tree | 61b1e9cb2cf21293196b23b7dcad345c6a41a930 /sql/item_timefunc.h | |
parent | 519c7305ac4e1e4bafe0acc56764fa40a0e621ab (diff) | |
download | mariadb-git-d106dc059746157239d951551093fec049a7b73a.tar.gz |
MDEV-5504 Server crashes in String::length on SELECT with MONTHNAME, GROUP BY, ROLLUP
The crash happened because Item_func_monthname was derived from
Item_func_month, so Item_func_monthname::is_null() did not work fine.
Backporting a change from 5.5: Item_func_monthname is now derived from
Item_str_func.
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r-- | sql/item_timefunc.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index d97a5fbc903..7d865df8fea 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -134,14 +134,13 @@ public: }; -class Item_func_monthname :public Item_func_month +class Item_func_monthname :public Item_str_func { MY_LOCALE *locale; public: - Item_func_monthname(Item *a) :Item_func_month(a) {} + Item_func_monthname(Item *a) :Item_str_func(a) {} const char *func_name() const { return "monthname"; } String *val_str(String *str); - enum Item_result result_type () const { return STRING_RESULT; } void fix_length_and_dec(); bool check_partition_func_processor(uchar *int_arg) {return TRUE;} bool check_vcol_func_processor(uchar *int_arg) {return FALSE;} |