Commit ffc61fb0 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-22534 Simplify the workaround for MDEV-31269

Skip exists2in transformations if we are in a ps execution
parent a87f2277
...@@ -3096,17 +3096,6 @@ static bool find_inner_outer_equalities(Item **conds, ...@@ -3096,17 +3096,6 @@ static bool find_inner_outer_equalities(Item **conds,
return TRUE; return TRUE;
} }
/* Check whether item tree intersects with the free list */
static bool intersects_free_list(Item *item, THD *thd)
{
for (const Item *to_find= thd->free_list; to_find; to_find= to_find->next)
if (item->walk(&Item::find_item_processor, 1, (void *) to_find))
return true;
return false;
}
/* /*
Prepare exists2in / decorrelation transformation Prepare exists2in / decorrelation transformation
...@@ -3133,19 +3122,9 @@ bool Item_exists_subselect::exists2in_prepare( ...@@ -3133,19 +3122,9 @@ bool Item_exists_subselect::exists2in_prepare(
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
DBUG_ASSERT(eqs.elements() != 0); DBUG_ASSERT(eqs.elements() != 0);
/* /* A workaround to avoid 2nd ps execution segfault (MDEV-31269). */
If we are in a ps/sp execution, check for and skip on
intersection with the temporary free list to avoid 2nd ps execution
segfault
*/
if (!thd->stmt_arena->is_conventional()) if (!thd->stmt_arena->is_conventional())
{ DBUG_RETURN(TRUE);
for (uint i= 0; i < (uint) eqs.elements(); i++)
{
if (intersects_free_list(*eqs.at(i).eq_ref, thd))
DBUG_RETURN(TRUE);
}
}
/* Determine whether the result will be correlated */ /* Determine whether the result will be correlated */
{ {
......
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