Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
10.0(EOL)
-
None
Description
Memory leak at sql_prepare.cc:
Prepared_statement::execute_server_runnable().
The memory was leaked because thd->lex was restored at the end of the function.
The fix is that the lex allocated in this function should delete its explain before the function returns, i.e. Lex's "explain" query statement has to be deleted before restoring saved variables to thd to avoid memory leak.
Code diff:
error= server_runnable->execute_server_code(thd);
|
 |
+ // Lex's "explain" query statement has to be deleted before
|
+ // restoring saved variables to thd to avoid memory leak.
|
+ delete_explain_query(lex);
|
thd->cleanup_after_query();
|