Commit fe5a7354 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

fixed memory leak

parent 35ab257c
...@@ -1232,6 +1232,8 @@ bool Item_sum_count_distinct::setup(THD *thd) ...@@ -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, init_tree(tree, min(thd->variables.max_heap_table_size,
thd->variables.sortbuff_size/16), 0, thd->variables.sortbuff_size/16), 0,
key_length, compare_key, 0, NULL, cmp_arg); key_length, compare_key, 0, NULL, cmp_arg);
...@@ -1850,6 +1852,9 @@ bool Item_func_group_concat::setup(THD *thd) ...@@ -1850,6 +1852,9 @@ bool Item_func_group_concat::setup(THD *thd)
} }
rec_offset = table->reclength - key_length; rec_offset = table->reclength - key_length;
if (tree_mode)
delete_tree(tree);
/* /*
choise function of sort choise function of sort
*/ */
......
...@@ -691,7 +691,7 @@ class Item_func_group_concat : public Item_sum ...@@ -691,7 +691,7 @@ class Item_func_group_concat : public Item_sum
warning_available(item.warning_available), warning_available(item.warning_available),
key_length(item.key_length), key_length(item.key_length),
rec_offset(item.rec_offset), rec_offset(item.rec_offset),
tree_mode(0), tree_mode(item.tree_mode),
distinct(item.distinct), distinct(item.distinct),
warning_for_row(item.warning_for_row), warning_for_row(item.warning_for_row),
separator(item.separator), separator(item.separator),
...@@ -707,7 +707,7 @@ class Item_func_group_concat : public Item_sum ...@@ -707,7 +707,7 @@ class Item_func_group_concat : public Item_sum
count_cut_values(item.count_cut_values), count_cut_values(item.count_cut_values),
original(&item) original(&item)
{ {
quick_group = 0; quick_group= item.quick_group;
}; };
~Item_func_group_concat(); ~Item_func_group_concat();
enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;} enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment