mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg11973-2 sql/item_subselect.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_update.cc: Auto merged mysql-test/r/trigger.result: SCCS merged mysql-test/t/trigger.test: SCCS merged
This commit is contained in:
@@ -1855,6 +1855,13 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
|
||||
SELECT_LEX *sl= lex->all_selects_list;
|
||||
DBUG_ENTER("reinit_stmt_before_use");
|
||||
|
||||
/*
|
||||
We have to update "thd" pointer in LEX, all its units and in LEX::result,
|
||||
since statements which belong to trigger body are associated with TABLE
|
||||
object and because of this can be used in different threads.
|
||||
*/
|
||||
lex->thd= thd;
|
||||
|
||||
if (lex->empty_field_list_on_rset)
|
||||
{
|
||||
lex->empty_field_list_on_rset= 0;
|
||||
@@ -1893,6 +1900,7 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
|
||||
unit->types.empty();
|
||||
/* for derived tables & PS (which can't be reset by Item_subquery) */
|
||||
unit->reinit_exec_mechanism();
|
||||
unit->set_thd(thd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1931,7 +1939,10 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
|
||||
lex->select_lex.leaf_tables= lex->leaf_tables_insert;
|
||||
|
||||
if (lex->result)
|
||||
{
|
||||
lex->result->cleanup();
|
||||
lex->result->set_thd(thd);
|
||||
}
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user