1# We want to make sure that the common case of
2# a connection which has not enabled tracing,
3# is optimized, i.e. neither Opt_trace_context_impl nor
4# Opt_trace_context_stmt is created.
5set debug="d,no_new_opt_trace_stmt";
6select 1;
71
81
9select * from information_schema.OPTIMIZER_TRACE;
10QUERY	TRACE	MISSING_BYTES_BEYOND_MAX_MEM_SIZE	INSUFFICIENT_PRIVILEGES
11set @a=25;
12set debug="default";
13set optimizer_trace="enabled=on";
14select 2;
152
162
17select * from information_schema.OPTIMIZER_TRACE;
18QUERY	TRACE	MISSING_BYTES_BEYOND_MAX_MEM_SIZE	INSUFFICIENT_PRIVILEGES
19select 2	{
20  "steps": [
21    {
22      "join_preparation": {
23        "select#": 1,
24        "steps": [
25          {
26            "expanded_query": "/* select#1 */ select 2 AS `2`"
27          }
28        ]
29      }
30    },
31    {
32      "join_optimization": {
33        "select#": 1,
34        "steps": [
35        ]
36      }
37    },
38    {
39      "join_execution": {
40        "select#": 1,
41        "steps": [
42        ]
43      }
44    }
45  ]
46}	0	0
47set optimizer_trace="enabled=off";
48set debug="d,no_new_opt_trace_stmt";
49select 3;
503
513
52select * from information_schema.OPTIMIZER_TRACE;
53QUERY	TRACE	MISSING_BYTES_BEYOND_MAX_MEM_SIZE	INSUFFICIENT_PRIVILEGES
54select 2	{
55  "steps": [
56    {
57      "join_preparation": {
58        "select#": 1,
59        "steps": [
60          {
61            "expanded_query": "/* select#1 */ select 2 AS `2`"
62          }
63        ]
64      }
65    },
66    {
67      "join_optimization": {
68        "select#": 1,
69        "steps": [
70        ]
71      }
72    },
73    {
74      "join_execution": {
75        "select#": 1,
76        "steps": [
77        ]
78      }
79    }
80  ]
81}	0	0
82