diff options
author | kostja@bodhi.local <> | 2006-08-02 14:13:01 +0400 |
---|---|---|
committer | kostja@bodhi.local <> | 2006-08-02 14:13:01 +0400 |
commit | 4bfc67fc3cccc1cec93641b78095132ecd87c749 (patch) | |
tree | ea898f8f24b260b3a08d72dd19588e5815d47e74 /sql/sql_prepare.cc | |
parent | 6cbc44c45c0f911c5f859871224c80332517420b (diff) | |
parent | 2336834e08c98fcc3132b831054883fe01bb13cb (diff) | |
download | mariadb-git-4bfc67fc3cccc1cec93641b78095132ecd87c749.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ffe54310843..6d35c441368 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2128,29 +2128,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; @@ -2165,7 +2157,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; } |