Commit 82c50dc4 authored by monty@mysql.com's avatar monty@mysql.com

Delete Items created during Prepared Stat (memory leak bug) (Bug #3451)

parent 7e3cf595
......@@ -1424,6 +1424,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
case COM_EXECUTE:
{
thd->free_list= NULL;
mysql_stmt_execute(thd, packet, packet_length);
break;
}
......
......@@ -1485,9 +1485,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
thd->stmt_backup.set_statement(thd);
thd->set_statement(stmt);
reset_stmt_for_execute(stmt);
#ifndef EMBEDDED_LIBRARY
if (stmt->param_count)
{
......@@ -1526,6 +1524,11 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
cleanup_items(stmt->free_list);
close_thread_tables(thd); // to close derived tables
thd->set_statement(&thd->stmt_backup);
/*
Free Items that were created during this execution of the PS by query
optimizer.
*/
free_items(thd->free_list);
DBUG_VOID_RETURN;
set_params_data_err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment