diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-08-07 21:45:54 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-08-07 21:45:54 +0200 |
commit | e19b07e657eb94a9d09ff39947287a020de314f3 (patch) | |
tree | 5bb699f108904df376131ff74dd4f61150d10e10 /sql | |
parent | 7a7e65b9fc7fab01ad92c8670eb0e6ea8d0ed58e (diff) | |
download | mariadb-git-e19b07e657eb94a9d09ff39947287a020de314f3.tar.gz |
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).
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_derived.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index c62fb81334a..8e8dbfc71d4 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -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: if (arena) thd->restore_active_arena(arena, &backup); |