diff options
-rw-r--r-- | sql/item_sum.cc | 5 | ||||
-rw-r--r-- | sql/item_sum.h | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 9dd6fb04dfb..e44edb25bc1 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1232,6 +1232,8 @@ bool Item_sum_count_distinct::setup(THD *thd) } } + if (use_tree) + delete_tree(tree); init_tree(tree, min(thd->variables.max_heap_table_size, thd->variables.sortbuff_size/16), 0, key_length, compare_key, 0, NULL, cmp_arg); @@ -1850,6 +1852,9 @@ bool Item_func_group_concat::setup(THD *thd) } rec_offset = table->reclength - key_length; + + if (tree_mode) + delete_tree(tree); /* choise function of sort */ diff --git a/sql/item_sum.h b/sql/item_sum.h index 6f0d7a028a7..ebb90c05215 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -691,7 +691,7 @@ class Item_func_group_concat : public Item_sum warning_available(item.warning_available), key_length(item.key_length), rec_offset(item.rec_offset), - tree_mode(0), + tree_mode(item.tree_mode), distinct(item.distinct), warning_for_row(item.warning_for_row), separator(item.separator), @@ -707,7 +707,7 @@ class Item_func_group_concat : public Item_sum count_cut_values(item.count_cut_values), original(&item) { - quick_group = 0; + quick_group= item.quick_group; }; ~Item_func_group_concat(); enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;} |