summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2004-06-15 16:03:16 +0500
committerunknown <ram@gw.mysql.r18.ru>2004-06-15 16:03:16 +0500
commit0f83847940dfa10ba641230607e52321f27df3a8 (patch)
tree28411be61405a826e3a2858d4e85950cfdd255f8 /sql/item_sum.cc
parent125f840133735bc1031d06612aa04f07800066b2 (diff)
parent2ef5b0ed4e87c38ad031b3005cdbd05a09fef69b (diff)
downloadmariadb-git-0f83847940dfa10ba641230607e52321f27df3a8.tar.gz
Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b4035 sql/item_strfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_sum.h: Auto merged
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 098ccf70861..7a8e15e0a9d 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -1685,6 +1685,9 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)),
String tmp((char *)&buff,sizeof(buff),default_charset_info), tmp2;
char *record= (char*) item->table->record[0];
+ if (item->result.length())
+ item->result.append(*item->separator);
+
tmp.length(0);
for (uint i= 0; i < item->arg_count_field; i++)
@@ -1714,14 +1717,6 @@ int dump_leaf_key(byte* key, uint32 count __attribute__((unused)),
item->result.append(*res);
}
}
- if (item->tree_mode) // Last item of tree
- {
- item->show_elements++;
- if (item->show_elements < item->tree->elements_in_tree)
- item->result.append(*item->separator);
- }
- else
- item->result.append(*item->separator);
/* stop if length of result more than group_concat_max_len */
if (item->result.length() > item->group_concat_max_len)
@@ -1752,7 +1747,7 @@ Item_func_group_concat::Item_func_group_concat(bool is_distinct,
tree_mode(0), distinct(is_distinct), warning_for_row(0),
separator(is_separator), tree(&tree_base), table(0),
order(0), tables_list(0),
- show_elements(0), arg_count_order(0), arg_count_field(0),
+ arg_count_order(0), arg_count_field(0),
count_cut_values(0)
{
Item *item_select;
@@ -1818,7 +1813,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
order(item->order),
tables_list(item->tables_list),
group_concat_max_len(item->group_concat_max_len),
- show_elements(item->show_elements),
arg_count_order(item->arg_count_order),
arg_count_field(item->arg_count_field),
field_list_offset(item->field_list_offset),
@@ -2126,15 +2120,9 @@ String* Item_func_group_concat::val_str(String* str)
return 0;
if (tree_mode)
{
- show_elements= 0;
tree_walk(tree, (tree_walk_action)&dump_leaf_key, (void*)this,
left_root_right);
}
- else
- {
- if (!warning_for_row)
- result.length(result.length()-separator->length());
- }
if (count_cut_values && !warning_available)
{
warning_available= TRUE;