summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2008-10-09 20:57:41 +0500
committerGleb Shchepa <gshchepa@mysql.com>2008-10-09 20:57:41 +0500
commit0c20c0f12ff15601e23bd45bcda70317a59d9380 (patch)
tree31d8d391b64b679bf2edfbcefbde5f071fb5e59c /sql
parentd9df61cc1d91f04a87abafb19fdd7ebf3039d084 (diff)
parenta83f5b18efaa54df3b56c86c1ab9244280447f24 (diff)
downloadmariadb-git-0c20c0f12ff15601e23bd45bcda70317a59d9380.tar.gz
manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_union.cc1
-rw-r--r--sql/sql_update.cc20
2 files changed, 20 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 5f7e3c5b620..2f3282f58f6 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -399,7 +399,6 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
else
{
- DBUG_ASSERT(!thd->stmt_arena->is_conventional());
/*
We're in execution of a prepared statement or stored procedure:
reset field items to point at fields from the created temporary table.
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