Commit e4598dae authored by kostja@bodhi.local's avatar kostja@bodhi.local

Merge bodhi.local:/opt/local/work/tmp_merge

into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41
parents fbf54f8d 0db71aaf
This diff is collapsed.
......@@ -126,6 +126,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->param_list.empty();
lex->view_list.empty();
lex->prepared_stmt_params.empty();
lex->auxilliary_table_list.empty();
lex->unit.next= lex->unit.master=
lex->unit.link_next= lex->unit.return_to= 0;
lex->unit.prev= lex->unit.link_prev= 0;
......
......@@ -2131,25 +2131,18 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
tables;
tables= tables->next_global)
{
tables->reinit_before_use(thd);
}
/*
Reset old pointers to TABLEs: they are not valid since the tables
were closed in the end of previous prepare or execute call.
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.
*/
tables->table= 0;
/* 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
for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxilliary_table_list.first;
tables;
tables= tables->next)
{
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);
tables->reinit_before_use(thd);
}
lex->current_select= &lex->select_lex;
......
......@@ -2985,6 +2985,23 @@ Field_iterator_table_ref::get_natural_column_ref()
return nj_col;
}
/*
Cleanup this table for re-execution.
SYNOPSIS
st_table_list::reinit_before_use()
*/
void st_table_list::reinit_before_use(THD * /* thd */)
{
/*
Reset old pointers to TABLEs: they are not valid since the tables
were closed in the end of previous prepare or execute call.
*/
table= 0;
table_list= 0;
}
/*****************************************************************************
** Instansiate templates
......
......@@ -672,6 +672,11 @@ typedef struct st_table_list
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);
/*
Cleanup for re-execution in a prepared statement or a stored
procedure.
*/
void reinit_before_use(THD *thd);
} TABLE_LIST;
class Item;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment