summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 652353fb722..1f465a100c9 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -707,8 +707,15 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
case SQLCOM_DELETE_MULTI:
case SQLCOM_UPDATE:
case SQLCOM_UPDATE_MULTI:
- if ((res= unit->prepare(derived, derived->derived_result, 0)))
+ if ((res= first_select->vers_setup_conds(thd,
+ derived->merge_underlying_list)))
goto exit;
+ if (derived->merge_underlying_list->where)
+ {
+ Query_arena_stmt on_stmt_arena(thd);
+ derived->where= and_items(thd, derived->where,
+ derived->merge_underlying_list->where);
+ }
default:
break;
}