diff options
author | unknown <bell@sanja.is.com.ua> | 2005-06-22 00:17:08 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-06-22 00:17:08 +0300 |
commit | ef36e81b2a78ced922f588e6de0c6daf167ffc36 (patch) | |
tree | c7da89101d71f79f6f2e902ad63e646e1707bf30 /sql/sp_head.cc | |
parent | 8f011afe0344f3500b4cfce4ea34be6dd5c7a0bc (diff) | |
download | mariadb-git-ef36e81b2a78ced922f588e6de0c6daf167ffc36.tar.gz |
fixed items cleunup for SP (BUG#10136)
mysql-test/r/sp.result:
test commented until bug#11394 fix
test for bug#10136
mysql-test/t/sp.test:
test commented until bug#11394 fix
bug10136
sql/sp_head.cc:
fixed items cleunup for SP
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index fae657a8caf..9e8a750b534 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -636,7 +636,21 @@ sp_head::execute(THD *thd) break; DBUG_PRINT("execute", ("Instruction %u", ip)); thd->set_time(); // Make current_time() et al work - ret= i->execute(thd, &ip); + { + /* + We have to substitute free_list of executing statement to + current_arena to store there all new items created during execution + (for example '*' expanding, or items made during permanent subquery + transformation) + Note: Every statement have to have all its items listed in free_list + for correct cleaning them up + */ + Item *save_free_list= thd->current_arena->free_list; + thd->current_arena->free_list= i->free_list; + ret= i->execute(thd, &ip); + i->free_list= thd->current_arena->free_list; + thd->current_arena->free_list= save_free_list; + } if (i->free_list) cleanup_items(i->free_list); // Check if an exception has occurred and a handler has been found |