1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-4593: p_s: crash in simplify_joins with delete using subselect from view

mysql_derived_merge_for_insert() should not be called for views or derived tables which are not put (directly or via other views) in main SELECT_LEX "join list".
This commit is contained in:
unknown
2013-06-06 23:33:40 +03:00
parent fce7fc43ba
commit ad947563ac
3 changed files with 36 additions and 1 deletions

View File

@ -83,7 +83,16 @@ mysql_handle_derived(LEX *lex, uint phases)
sl && !res;
sl= sl->next_select_in_list())
{
for (TABLE_LIST *cursor= sl->get_table_list();
TABLE_LIST *cursor= sl->get_table_list();
/*
DT_MERGE_FOR_INSERT is not needed for views/derived tables inside
subqueries. Views and derived tables of subqueries should be
processed normally.
*/
if (phases == DT_MERGE_FOR_INSERT &&
cursor && cursor->top_table()->select_lex != &lex->select_lex)
continue;
for (;
cursor && !res;
cursor= cursor->next_local)
{