summaryrefslogtreecommitdiff
path: root/sql/opt_trace.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/opt_trace.cc')
-rw-r--r--sql/opt_trace.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/opt_trace.cc b/sql/opt_trace.cc
index 4bc493940fb..33209ff0a8c 100644
--- a/sql/opt_trace.cc
+++ b/sql/opt_trace.cc
@@ -491,7 +491,8 @@ void Opt_trace_start::init(THD *thd,
!list_has_optimizer_trace_table(tbl) &&
!sets_var_optimizer_trace(sql_command, set_vars) &&
!thd->system_thread &&
- !ctx->disable_tracing_if_required())
+ !ctx->disable_tracing_if_required() &&
+ !(thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_PREPARE))
{
ctx->start(thd, tbl, sql_command, query, query_length, query_charset,
thd->variables.optimizer_trace_max_mem_size);