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;
......
...@@ -2128,28 +2128,21 @@ void reinit_stmt_before_use(THD *thd, LEX *lex) ...@@ -2128,28 +2128,21 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
they have their own table list). they have their own table list).
*/ */
for (TABLE_LIST *tables= lex->query_tables; for (TABLE_LIST *tables= lex->query_tables;
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 }
were closed in the end of previous prepare or execute call. /*
*/ Cleanup of the special case of DELETE t1, t2 FROM t1, t2, t3 ...
tables->table= 0; (multi-delete). We do a full clean up, although at the moment all we
/* Reset is_schema_table_processed value(needed for I_S tables */ need to clean in the tables of MULTI-DELETE list is 'table' member.
tables->is_schema_table_processed= FALSE; */
for (TABLE_LIST *tables= (TABLE_LIST*) lex->auxilliary_table_list.first;
TABLE_LIST *embedded; /* The table at the current level of nesting. */ tables;
TABLE_LIST *embedding= tables; /* The parent nested table reference. */ tables= tables->next)
do {
{ tables->reinit_before_use(thd);
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; 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