Commit d8b447a1 authored by unknown's avatar unknown

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

into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge-41


ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/ps.result:
  Manual merge: use local.
mysql-test/t/ps.test:
  Manual merge: remove duplicate test cases from ps.test.
sql/sql_lex.cc:
  Manual merge.
sql/sql_prepare.cc:
  Manual merge.
sql/table.h:
  Manual merge.
parents 67d53e36 4cb0659d
This diff is collapsed.
...@@ -126,6 +126,7 @@ void lex_start(THD *thd, uchar *buf,uint length) ...@@ -126,6 +126,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->param_list.empty(); lex->param_list.empty();
lex->view_list.empty(); lex->view_list.empty();
lex->prepared_stmt_params.empty(); lex->prepared_stmt_params.empty();
lex->auxilliary_table_list.empty();
lex->unit.next= lex->unit.master= lex->unit.next= lex->unit.master=
lex->unit.link_next= lex->unit.return_to= 0; lex->unit.link_next= lex->unit.return_to= 0;
lex->unit.prev= lex->unit.link_prev= 0; lex->unit.prev= lex->unit.link_prev= 0;
......
...@@ -2131,25 +2131,18 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) ...@@ -2131,25 +2131,18 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
tables; tables;
tables= tables->next_global) tables= tables->next_global)
{ {
tables->reinit_before_use(thd);
}
/* /*
Reset old pointers to TABLEs: they are not valid since the tables Cleanup of the special case of DELETE t1, t2 FROM t1, t2, t3 ...
were closed in the end of previous prepare or execute call. (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; for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxilliary_table_list.first;
/* Reset is_schema_table_processed value(needed for I_S tables */ tables;
tables->is_schema_table_processed= FALSE; tables= tables->next)
TABLE_LIST *embedded; /* The table at the current level of nesting. */
TABLE_LIST *embedding= tables; /* The parent nested table reference. */
do
{ {
embedded= embedding; tables->reinit_before_use(thd);
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; lex->current_select= &lex->select_lex;
......
...@@ -2985,6 +2985,23 @@ Field_iterator_table_ref::get_natural_column_ref() ...@@ -2985,6 +2985,23 @@ Field_iterator_table_ref::get_natural_column_ref()
return nj_col; 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 ** Instansiate templates
......
...@@ -672,6 +672,11 @@ typedef struct st_table_list ...@@ -672,6 +672,11 @@ typedef struct st_table_list
private: private:
bool prep_check_option(THD *thd, uint8 check_opt_type); bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause); 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; } TABLE_LIST;
class Item; 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