diff options
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a9decdbdf04..1a210f79ce5 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1336,12 +1336,14 @@ bool Item_func_sformat::fix_length_and_dec() if (c.collation->mbminlen > 1) c.collation= &my_charset_utf8mb4_bin; - if (Type_std_attributes::agg_item_set_converter(c, func_name_cstring(), args, - arg_count, flags, 1)) - return TRUE; - for (uint i=0 ; i < arg_count ; i++) + { char_length+= args[i]->max_char_length(); + if (args[i]->result_type() == STRING_RESULT && + Type_std_attributes::agg_item_set_converter(c, func_name_cstring(), + args+i, 1, flags, 1)) + return TRUE; + } fix_char_length_ulonglong(char_length); return FALSE; |