Debian Codegraph @

mysql-test/suite/opt_trace/t/debug.test

raw
1 # Continuation of tests for optimizer trace.
2 # Those need DBUG_EXECUTE_IF.
3
4 --source include/have_optimizer_trace.inc
5 --source include/no_ps_protocol.inc
6 --source include/have_debug.inc
7
8 --echo # We want to make sure that the common case of
9 --echo # a connection which has not enabled tracing,
10 --echo # is optimized, i.e. neither Opt_trace_context_impl nor
11 --echo # Opt_trace_context_stmt is created.
12
13 # make server crash if it creates Opt_trace_stmt
14 set debug="d,no_new_opt_trace_stmt";
15
16 # tracable but tracing is off
17 select 1;
18 # non-tracable
19 select * from information_schema.OPTIMIZER_TRACE;
20 # non-tracable
21 set @a=25;
22
23 # Force creation of Opt_trace_context_impl and Opt_trace_stmt
24 set debug="default";
25 set optimizer_trace="enabled=on";
26 select 2;
27 select * from information_schema.OPTIMIZER_TRACE;
28 set optimizer_trace="enabled=off";
29 set debug="d,no_new_opt_trace_stmt";
30
31 # tracable, but tracing is off again (thd->opt_trace->is_started() is false)
32 select 3;
33 # should see only trace of "select 2"
34 select * from information_schema.OPTIMIZER_TRACE;