mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
Delete Items created during Prepared Stat (memory leak bug) (Bug #3451)
This commit is contained in:
parent
7e3cf5958c
commit
82c50dc49d
2 changed files with 6 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue