Commit f2ebd039 authored by unknown's avatar unknown

fixed memory leak in ROW code (SCRUM 577)

sql/item_cmpfunc.cc:
  fixed memory leak in ROW code
sql/item_cmpfunc.h:
  fixed memory leak in ROW code
parent d7db6bee
......@@ -1078,6 +1078,7 @@ in_string::in_string(uint elements,qsort_cmp cmp_func)
in_string::~in_string()
{
if (base)
for (uint i=0 ; i < count ; i++)
((String*) base)[i].free();
}
......@@ -1100,12 +1101,20 @@ byte *in_string::get_value(Item *item)
in_row::in_row(uint elements, Item * item)
{
DBUG_ENTER("in_row::in_row");
base= (char*) new cmp_item_row[elements];
base= (char*) new cmp_item_row[count= elements];
size= sizeof(cmp_item_row);
compare= (qsort_cmp) cmp_row;
tmp.store_value(item);
DBUG_VOID_RETURN;
}
in_row::~in_row()
{
if (base)
{
cmp_item_row *arr= (cmp_item_row *) base;
for (uint i=0 ; i < count ; i++)
arr[i].~cmp_item_row();
}
}
byte *in_row::get_value(Item *item)
......
......@@ -557,6 +557,7 @@ class in_row :public in_vector
cmp_item_row tmp;
public:
in_row(uint elements, Item *);
~in_row();
void set(uint pos,Item *item);
byte *get_value(Item *item);
};
......
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