Commit 9ff63ae1 authored by unknown's avatar unknown

Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/psergey/mysql-5.0-merge

parents 057855a3 9f0a79cb
...@@ -942,11 +942,12 @@ int sp_head::execute(THD *thd) ...@@ -942,11 +942,12 @@ int sp_head::execute(THD *thd)
*/ */
thd->stmt_arena= i; thd->stmt_arena= i;
/* will binlog this separately */ /*
if (thd->prelocked_mode == NON_PRELOCKED) //TODO: change to event union? Will write this SP statement into binlog separately
{ (TODO: consider changing the condition to "not inside event union")
*/
if (thd->prelocked_mode == NON_PRELOCKED)
thd->user_var_events_alloc= thd->mem_root; thd->user_var_events_alloc= thd->mem_root;
}
ret= i->execute(thd, &ip); ret= i->execute(thd, &ip);
...@@ -960,6 +961,16 @@ int sp_head::execute(THD *thd) ...@@ -960,6 +961,16 @@ int sp_head::execute(THD *thd)
cleanup_items(i->free_list); cleanup_items(i->free_list);
i->state= Query_arena::EXECUTED; i->state= Query_arena::EXECUTED;
/*
If we've set thd->user_var_events_alloc to mem_root of this SP
statement, clean all the events allocated in it.
*/
if (thd->prelocked_mode == NON_PRELOCKED)
{
reset_dynamic(&thd->user_var_events);
thd->user_var_events_alloc= NULL;//DEBUG
}
/* we should cleanup free_list and memroot, used by instruction */ /* we should cleanup free_list and memroot, used by instruction */
thd->free_items(); thd->free_items();
free_root(&execute_mem_root, MYF(0)); free_root(&execute_mem_root, MYF(0));
......
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