diff options
author | unknown <gluh@mysql.com/eagle.(none)> | 2007-10-29 14:53:10 +0400 |
---|---|---|
committer | unknown <gluh@mysql.com/eagle.(none)> | 2007-10-29 14:53:10 +0400 |
commit | 556dd754e3fe8e5ae1ed1f2acb69e0b4ad8101ca (patch) | |
tree | e9ab3d58ec98a2efbd68784b13c552d3122acceb /sql/item_sum.cc | |
parent | 5a124bd92e86048d28be2467ffbb015cedfeaa87 (diff) | |
download | mariadb-git-556dd754e3fe8e5ae1ed1f2acb69e0b4ad8101ca.tar.gz |
Bug#30897 GROUP_CONCAT returns extra comma on empty fields
The fix is a copy of Martin Friebe's suggestion.
added testing for no_appended which will be false if anything,
including the empty string is in result
mysql-test/r/func_gconcat.result:
test result
mysql-test/t/func_gconcat.test:
test case
sql/item_sum.cc:
added testing for no_appended which will be False if anything,
including the empty string is in result
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 30cbe872101..ad8ebd0791c 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -3406,7 +3406,7 @@ String* Item_func_group_concat::val_str(String* str) DBUG_ASSERT(fixed == 1); if (null_value) return 0; - if (!result.length() && tree) + if (no_appended && tree) /* Tree is used for sorting as in ORDER BY */ tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this, left_root_right); |