Commit 23a22970 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-32223 Memory leak showed in MDEV-6146 test suite

Fix Item_func_match to avoid removing Item_direct_ref_to_item from item tree via real_item() call.
parent 4e259476
...@@ -6098,7 +6098,8 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref) ...@@ -6098,7 +6098,8 @@ bool Item_func_match::fix_fields(THD *thd, Item **ref)
table= 0; table= 0;
for (uint i=1 ; i < arg_count ; i++) for (uint i=1 ; i < arg_count ; i++)
{ {
item= args[i]= args[i]->real_item();
item= args[i]->real_item();
/* /*
When running in PS mode, some Item_field's can already be replaced When running in PS mode, some Item_field's can already be replaced
to Item_func_conv_charset during PREPARE time. This is possible to Item_func_conv_charset during PREPARE time. This is possible
...@@ -6187,9 +6188,10 @@ bool Item_func_match::fix_index() ...@@ -6187,9 +6188,10 @@ bool Item_func_match::fix_index()
for (i=1; i < arg_count; i++) for (i=1; i < arg_count; i++)
{ {
if (args[i]->type() != FIELD_ITEM) Item *real_item= args[i]->real_item();
if (real_item->type() != FIELD_ITEM)
goto err; goto err;
item=(Item_field*)args[i]; item=(Item_field*)real_item;
for (keynr=0 ; keynr < fts ; keynr++) for (keynr=0 ; keynr < fts ; keynr++)
{ {
KEY *ft_key=&table->key_info[ft_to_key[keynr]]; KEY *ft_key=&table->key_info[ft_to_key[keynr]];
......
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