diff options
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 431d6822f0e..92923779be7 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -772,7 +772,9 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, if (saved_error) goto err; - if (fake_select_lex != NULL && thd->stmt_arena->is_stmt_prepare()) + if (fake_select_lex != NULL && + (thd->stmt_arena->is_stmt_prepare() || + (thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW))) { /* Validate the global parameters of this union */ |