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

fixed memory allocation

parent a684227c
...@@ -1416,16 +1416,16 @@ cmp_item_row::~cmp_item_row() ...@@ -1416,16 +1416,16 @@ cmp_item_row::~cmp_item_row()
void cmp_item_row::store_value(Item *item) void cmp_item_row::store_value(Item *item)
{ {
DBUG_ENTER("cmp_item_row::store_value"); DBUG_ENTER("cmp_item_row::store_value");
THD *thd= current_thd;
n= item->cols(); n= item->cols();
if (!comparators) if (!comparators)
comparators= (cmp_item **) thd->calloc(sizeof(cmp_item *)*n); comparators= (cmp_item **) current_thd->calloc(sizeof(cmp_item *)*n);
if (comparators) if (comparators)
{ {
item->bring_value(); item->bring_value();
item->null_value= 0; item->null_value= 0;
for (uint i=0; i < n; i++) for (uint i=0; i < n; i++)
{ {
if (!comparators[i])
if (!(comparators[i]= cmp_item::get_comparator(item->el(i)))) if (!(comparators[i]= cmp_item::get_comparator(item->el(i))))
break; // new failed break; // new failed
comparators[i]->store_value(item->el(i)); comparators[i]->store_value(item->el(i));
......
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