mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Applied Sanja's patch to fix LP bug #784297 in the tree for mwl106.
The patch imposes unconditional materialization for derived tables used in update and multi-update statements. Fixed a bug with a wrong order of processing derived tables/views at the prepare stage that caused a crash for the variant of the query from test case for bug 52157.
This commit is contained in:
@@ -944,3 +944,27 @@ void st_select_lex::cleanup_all_joins(bool full)
|
||||
for (sl= unit->first_select(); sl; sl= sl->next_select())
|
||||
sl->cleanup_all_joins(full);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Set exclude_from_table_unique_test for selects of this unit and all
|
||||
underlying selects.
|
||||
|
||||
@note used to exclude materialized derived tables (views) from unique
|
||||
table check.
|
||||
*/
|
||||
|
||||
void st_select_lex_unit::set_unique_exlude()
|
||||
{
|
||||
for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select())
|
||||
{
|
||||
sl->exclude_from_table_unique_test= TRUE;
|
||||
for (SELECT_LEX_UNIT *unit= sl->first_inner_unit();
|
||||
unit;
|
||||
unit= unit->next_unit())
|
||||
{
|
||||
unit->set_unique_exlude();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user