diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-10-09 20:57:41 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-10-09 20:57:41 +0500 |
commit | ac1c5f5046304bd09224cd9702a06f73b755fb68 (patch) | |
tree | 31d8d391b64b679bf2edfbcefbde5f071fb5e59c /sql/sql_update.cc | |
parent | 90e054191532d772dffd802706c0d4909e1cc5d4 (diff) | |
parent | 0b38c93d6e1cc66eb798a59be817f744936b1505 (diff) | |
download | mariadb-git-ac1c5f5046304bd09224cd9702a06f73b755fb68.tar.gz |
manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index bfc69618c2b..197e5290aba 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1100,6 +1100,26 @@ reopen_tables: tbl->cleanup_items(); /* + To not to hog memory (as a result of the + unit->reinit_exec_mechanism() call below): + */ + lex->unit.cleanup(); + + for (SELECT_LEX *sl= lex->all_selects_list; + sl; + sl= sl->next_select_in_list()) + { + SELECT_LEX_UNIT *unit= sl->master_unit(); + unit->reinit_exec_mechanism(); // reset unit->prepared flags + /* + Reset 'clean' flag back to force normal execution of + unit->cleanup() in Prepared_statement::cleanup_stmt() + (call to lex->unit.cleanup() above sets this flag to TRUE). + */ + unit->unclean(); + } + + /* Also we need to cleanup Natural_join_column::table_field items. To not to traverse a join tree we will cleanup whole thd->free_list (in PS execution mode that list may not contain |