mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 11:45:32 +02: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:
parent
207f008220
commit
4bed7aa858
11 changed files with 18 additions and 7 deletions
|
|
@ -228,6 +228,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
|||
query_plan.using_filesort= FALSE;
|
||||
DBUG_ENTER("mysql_delete");
|
||||
|
||||
create_explain_query(thd->lex, thd->mem_root);
|
||||
if (open_and_lock_tables(thd, table_list, TRUE, 0))
|
||||
DBUG_RETURN(TRUE);
|
||||
|
||||
|
|
@ -457,7 +458,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
|||
*/
|
||||
if (thd->lex->describe)
|
||||
goto exit_without_my_ok;
|
||||
|
||||
|
||||
query_plan.save_explain_data(thd->lex->explain);
|
||||
|
||||
DBUG_EXECUTE_IF("show_explain_probe_delete_exec_start",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue