summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-08-07 21:45:54 +0200
committerSergei Golubchik <sergii@pisem.net>2014-08-07 21:45:54 +0200
commite19b07e657eb94a9d09ff39947287a020de314f3 (patch)
tree5bb699f108904df376131ff74dd4f61150d10e10 /sql/sql_derived.cc
parent7a7e65b9fc7fab01ad92c8670eb0e6ea8d0ed58e (diff)
downloadmariadb-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/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc2
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);