From 4bed7aa858e7946471fb37ce30f3273ec28867ce Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Wed, 16 Oct 2013 12:13:51 +0400 Subject: 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. --- sql/sql_insert.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 24b43442e2a..b21650dc559 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -719,6 +719,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, Item *unused_conds= 0; DBUG_ENTER("mysql_insert"); + create_explain_query(thd->lex, thd->mem_root); /* Upgrade lock type if the requested lock is incompatible with the current connection mode or table operation. -- cgit v1.2.1