summaryrefslogtreecommitdiff
path: root/sql/sql_update.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2008-10-08 02:52:49 +0500
committerGleb Shchepa <gshchepa@mysql.com>2008-10-08 02:52:49 +0500
commit7c70643dd89a3d00a053651de00f85ed461bff28 (patch)
tree0410f91fd4242a83c6223b770ea87e32d5e28c00 /sql/sql_update.cc
parente3dc7c9634ac1a7adb02cc2c3b7f600912758b3c (diff)
parentfd777ae1986ab06d9b9c1a27ffa7b19c6dde4a6c (diff)
downloadmariadb-git-7c70643dd89a3d00a053651de00f85ed461bff28.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.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index e2ed3371711..bfc69618c2b 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -1076,11 +1076,14 @@ reopen_tables:
}
/* now lock and fill tables */
- if (lock_tables(thd, table_list, table_count, &need_reopen))
+ if (!thd->stmt_arena->is_stmt_prepare() &&
+ lock_tables(thd, table_list, table_count, &need_reopen))
{
if (!need_reopen)
DBUG_RETURN(TRUE);
+ DBUG_PRINT("info", ("lock_tables failed, reopening"));
+
/*
We have to reopen tables since some of them were altered or dropped
during lock_tables() or something was done with their triggers.
@@ -1096,6 +1099,14 @@ reopen_tables:
for (TABLE_LIST *tbl= table_list; tbl; tbl= tbl->next_global)
tbl->cleanup_items();
+ /*
+ 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
+ items from 'fields' list, so the cleanup above is necessary to.
+ */
+ cleanup_items(thd->free_list);
+
close_tables_for_reopen(thd, &table_list);
goto reopen_tables;
}