summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorkostja@bodhi.local <>2006-08-12 21:06:51 +0400
committerkostja@bodhi.local <>2006-08-12 21:06:51 +0400
commit04c97488f91c3db48be384c2ed14082dc6d6616b (patch)
treecccb1fdd583e353f4a229cbb0f9d585104db78f9 /sql/sql_prepare.cc
parentb341356abdfa869c71d42709a13c2192603fab1c (diff)
parent6691c623100134d666b142f5752fcc022bdd1ac9 (diff)
downloadmariadb-git-04c97488f91c3db48be384c2ed14082dc6d6616b.tar.gz
Merge bodhi.local:/opt/local/work/tmp_merge
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc36
1 files changed, 14 insertions, 22 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index ca31845ff95..16508516df7 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2134,29 +2134,21 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
they have their own table list).
*/
for (TABLE_LIST *tables= lex->query_tables;
- tables;
- tables= tables->next_global)
+ tables;
+ tables= tables->next_global)
+ {
+ tables->reinit_before_use(thd);
+ }
+ /*
+ Cleanup of the special case of DELETE t1, t2 FROM t1, t2, t3 ...
+ (multi-delete). We do a full clean up, although at the moment all we
+ need to clean in the tables of MULTI-DELETE list is 'table' member.
+ */
+ for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxiliary_table_list.first;
+ tables;
+ tables= tables->next_global)
{
- /*
- Reset old pointers to TABLEs: they are not valid since the tables
- were closed in the end of previous prepare or execute call.
- */
tables->reinit_before_use(thd);
-
- /* Reset is_schema_table_processed value(needed for I_S tables */
- tables->is_schema_table_processed= FALSE;
-
- TABLE_LIST *embedded; /* The table at the current level of nesting. */
- TABLE_LIST *embedding= tables; /* The parent nested table reference. */
- do
- {
- embedded= embedding;
- if (embedded->prep_on_expr)
- embedded->on_expr= embedded->prep_on_expr->copy_andor_structure(thd);
- embedding= embedded->embedding;
- }
- while (embedding &&
- embedding->nested_join->join_list.head() == embedded);
}
lex->current_select= &lex->select_lex;
@@ -2171,7 +2163,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
}
lex->allow_sum_func= 0;
lex->in_sum_func= NULL;
- DBUG_VOID_RETURN;
+ DBUG_VOID_RETURN;
}