mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#38499: flush tables and multitable table update with
derived table cause crash When a multi-UPDATE command fails to lock some table, and subsequently succeeds, the tables need to be reopened if they were altered. But the reopening procedure failed for derived tables. Extra cleanup has been added.
This commit is contained in:
@ -875,6 +875,26 @@ reopen_tables:
|
||||
for (TABLE_LIST *tbl= table_list; tbl; tbl= tbl->next_global)
|
||||
tbl->cleanup_items();
|
||||
|
||||
/*
|
||||
To not to hog memory (as a result of the
|
||||
unit->reinit_exec_mechanism() call below):
|
||||
*/
|
||||
lex->unit.cleanup();
|
||||
|
||||
for (SELECT_LEX *sl= lex->all_selects_list;
|
||||
sl;
|
||||
sl= sl->next_select_in_list())
|
||||
{
|
||||
SELECT_LEX_UNIT *unit= sl->master_unit();
|
||||
unit->reinit_exec_mechanism(); // reset unit->prepared flags
|
||||
/*
|
||||
Reset 'clean' flag back to force normal execution of
|
||||
unit->cleanup() in Prepared_statement::cleanup_stmt()
|
||||
(call to lex->unit.cleanup() above sets this flag to TRUE).
|
||||
*/
|
||||
unit->unclean();
|
||||
}
|
||||
|
||||
/*
|
||||
Also we need to cleanup Natural_join_column::table_field items.
|
||||
To not to traverse a join tree we will cleanup whole
|
||||
|
Reference in New Issue
Block a user