Commit e19b07e6 authored by Sergei Golubchik's avatar Sergei Golubchik

crash in main.views (and other view + PS tests)

When a view is merged, mark its select_lex as already optimized, otherwise
its where clause (which doesn't have to be a valid Item after merging)
might be accessed later. But don't do that for inserts (where a view cannot
be simply merged, if one later needs to insert into it).
parent 7a7e65b9
...@@ -465,6 +465,8 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived) ...@@ -465,6 +465,8 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
} }
} }
if (!derived->merged_for_insert)
dt_select->first_cond_optimization= FALSE; // consider it optimized
exit_merge: exit_merge:
if (arena) if (arena)
thd->restore_active_arena(arena, &backup); thd->restore_active_arena(arena, &backup);
......
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