mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETE, Memory leak in binlog.binlog_base64_flag:
- It turns out, there are statements that will call lex_start(thd->lex) after parsing has been finished. lex_start() will set lex->explain=NULL, which will lose the pointer to already allocated Explain_plan object. - To get rid of this, switch to lazy creation of lex->explain. Now, it is created only when we get a part ot query plan.
This commit is contained in:
@ -631,8 +631,10 @@ bool st_select_lex_unit::exec()
|
||||
item->make_const();
|
||||
|
||||
saved_error= optimize();
|
||||
|
||||
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
|
||||
|
||||
if (!saved_error && !was_executed && thd->lex->explain)
|
||||
if (!saved_error && !was_executed)
|
||||
save_union_explain(thd->lex->explain);
|
||||
|
||||
if (uncacheable || !item || !item->assigned() || describe)
|
||||
@ -782,7 +784,7 @@ bool st_select_lex_unit::exec()
|
||||
if (!fake_select_lex->ref_pointer_array)
|
||||
fake_select_lex->n_child_sum_items+= global_parameters->n_sum_items;
|
||||
|
||||
if (!was_executed && thd->lex->explain)
|
||||
if (!was_executed)
|
||||
save_union_explain_part2(thd->lex->explain);
|
||||
|
||||
saved_error= mysql_select(thd, &fake_select_lex->ref_pointer_array,
|
||||
|
Reference in New Issue
Block a user