summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 1bc7b36775a..5bbecb88bb6 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -9551,8 +9551,10 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view)
(!first_select->group_list.elements &&
!first_select->order_list.elements)) &&
(is_view() ||
- (optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE) &&
- !thd->lex->can_not_use_merged(1))) &&
+ optimizer_flag(thd, OPTIMIZER_SWITCH_DERIVED_MERGE)) &&
+ !thd->lex->can_not_use_merged() &&
+ !((thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
+ thd->lex->sql_command == SQLCOM_DELETE_MULTI) && !is_view()) &&
!is_recursive_with_table())
set_merged_derived();
else