Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
None
-
None
Description
There is following hack:
// in PS use own arena or data will be freed after prepare
|
if (register_tree_change &&
|
thd->stmt_arena->is_stmt_prepare_or_first_stmt_execute())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
Which create rolled back view reference items but in persistent memory.
It used (for example) by semijoin expression constructor:
/*
|
Create Item_func_eq. Note that
|
1. this is done on the statement, not execution, arena
|
2. if it's a PS then this happens only once - on the first execution.
|
On following re-executions, the item will be fix_field-ed normally.
|
3. Thus it should be created as if it was fix_field'ed, in particular
|
all pointers to items in the execution arena should be protected
|
with thd->change_item_tree
|
*/
|
Item_func_eq *item_eq=
|
new Item_func_eq(subq_pred->left_expr_orig, subq_lex->ref_pointer_array[0]);
|
if (!item_eq)
|
DBUG_RETURN(TRUE);
|
if (subq_pred->left_expr_orig != subq_pred->left_expr)
|
thd->change_item_tree(item_eq->arguments(), subq_pred->left_expr);
|
item_eq->in_equality_no= 0;
|
sj_nest->sj_on_expr= and_items(sj_nest->sj_on_expr, item_eq);
|
where right part of equality will never rolled back correctly but just will use persistent Item.
This rolling back was made by historically and is not needed any more so can be removed.
Attachments
Issue Links
- relates to
-
MDEV-15492 Subquery crash similar to MDEV-10050
- Closed