summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorigor@rurik.mysql.com <>2005-09-06 22:20:11 -0700
committerigor@rurik.mysql.com <>2005-09-06 22:20:11 -0700
commitaf9740d0fd82fbcde0237ac08911aaee99fbaa68 (patch)
treea15c71fa469ce1f2ad833049715ab009a914378a /sql/item_sum.cc
parent81948e621a16abd01d1a790cfafbdc8dd319a3e1 (diff)
downloadmariadb-git-af9740d0fd82fbcde0237ac08911aaee99fbaa68.tar.gz
func_gconcat.result, func_gconcat.test:
Added test cases for bug #12863. item_sum.cc, item_sum.h: Fixed bug #12863. Added a flag to Item_func_group_concat set to FALSE after concatenation of the first element of a group.
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 000dcdb4997..7f13fdf82b2 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1664,7 +1664,9 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)),
char buff[MAX_FIELD_WIDTH];
String tmp((char *)&buff,sizeof(buff),default_charset_info), tmp2;
- if (item->result.length())
+ if (item->no_appended)
+ item->no_appended= FALSE;
+ else
item->result.append(*item->separator);
tmp.length(0);
@@ -1856,6 +1858,7 @@ void Item_func_group_concat::clear()
result.copy();
null_value= TRUE;
warning_for_row= FALSE;
+ no_appended= TRUE;
if (tree_mode)
reset_tree(tree);
}
@@ -1898,8 +1901,7 @@ bool Item_func_group_concat::add()
void Item_func_group_concat::reset_field()
{
- if (tree_mode)
- reset_tree(tree);
+ DBUG_ASSERT(0);
}