mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +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:
@@ -1020,6 +1020,7 @@ int JOIN::optimize()
|
||||
*/
|
||||
if (was_optimized != optimized && !res && have_query_plan != QEP_DELETED)
|
||||
{
|
||||
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
|
||||
have_query_plan= QEP_AVAILABLE;
|
||||
save_explain_data(thd->lex->explain, false /* can overwrite */,
|
||||
need_tmp,
|
||||
|
Reference in New Issue
Block a user