MDEV-16803: Pushdown Item_func_in item that uses vectors in several SELECTs

The bug appears because of the Item_func_in::build_clone() method.
The 'array' field for the Item_func_in item that can be pushed into
the materialized view/derived table was built in the wrong way.
It becomes lame after the pushdown of the condition into the first
SELECT that defines that view/derived table. The server crashes in
the pushdown into the next SELECT while trying to use already lame
'array' field.

To fix it Item_func_in::build_clone() was changed.
This commit is contained in:
Galina Shalygina 2018-08-01 20:44:59 +03:00
commit 55163ba1bd
3 changed files with 42 additions and 2 deletions

View file

@ -4436,9 +4436,8 @@ Item *Item_func_in::build_clone(THD *thd, MEM_ROOT *mem_root)
Item_func_in *clone= (Item_func_in *) Item_func::build_clone(thd, mem_root);
if (clone)
{
if (array && clone->create_array(thd))
return NULL;
bzero(&clone->cmp_items, sizeof(cmp_items));
clone->fix_length_and_dec();
}
return clone;
}