diff options
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index f6544d76504..4f991615bfa 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2740,7 +2740,9 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)), String *result= &item->result; Item **arg= item->args, **arg_end= item->args + item->arg_count_field; - if (result->length()) + if (item->no_appended) + item->no_appended= FALSE; + else result->append(*item->separator); tmp.length(0); @@ -2925,6 +2927,7 @@ void Item_func_group_concat::clear() result.copy(); null_value= TRUE; warning_for_row= FALSE; + no_appended= TRUE; if (tree) reset_tree(tree); /* No need to reset the table as we never call write_row */ @@ -3001,6 +3004,7 @@ Item_func_group_concat::fix_fields(THD *thd, Item **ref) args, arg_count, MY_COLL_ALLOW_CONV)) return 1; + result.set_charset(collation.collation); result_field= 0; null_value= 1; thd->allow_sum_func= 1; |