| 1 |
connect con1, localhost, user1, , ; |
| 2 |
select "MARKER_BEGIN" as marker; |
| 3 |
marker |
| 4 |
MARKER_BEGIN |
| 5 |
select "This is simple statement one" as payload; |
| 6 |
payload |
| 7 |
This is simple statement one |
| 8 |
select "This is simple statement two" as payload; |
| 9 |
payload |
| 10 |
This is simple statement two |
| 11 |
select "This is the first part of a multi query" as payload; |
| 12 |
select "And this is the second part of a multi query" as payload; |
| 13 |
select "With a third part to make things complete" as payload; |
| 14 |
$$ |
| 15 |
payload |
| 16 |
This is the first part of a multi query |
| 17 |
payload |
| 18 |
And this is the second part of a multi query |
| 19 |
payload |
| 20 |
With a third part to make things complete |
| 21 |
select "MARKER_END" as marker; |
| 22 |
marker |
| 23 |
MARKER_END |
| 24 |
select "Con1 is done with payload" as status; |
| 25 |
status |
| 26 |
Con1 is done with payload |
| 27 |
connection default; |
| 28 |
set @con1_tid = (select thread_id from performance_schema.threads |
| 29 |
where processlist_user = 'user1'); |
| 30 |
select (@con1_tid is not null) as expected; |
| 31 |
expected |
| 32 |
1 |
| 33 |
set @marker_begin = (select event_id from performance_schema.events_statements_history_long |
| 34 |
where sql_text like "%MARKER_BEGIN%" and thread_id = @con1_tid); |
| 35 |
select (@marker_begin is not null) as expected; |
| 36 |
expected |
| 37 |
1 |
| 38 |
set @marker_end = (select end_event_id from performance_schema.events_statements_history_long |
| 39 |
where sql_text like "%MARKER_END%" and thread_id = @con1_tid); |
| 40 |
select (@marker_end is not null) as expected; |
| 41 |
expected |
| 42 |
1 |
| 43 |
show global status like "performance_schema%"; |
| 44 |
Variable_name Value |
| 45 |
Performance_schema_accounts_lost 0 |
| 46 |
Performance_schema_cond_classes_lost 0 |
| 47 |
Performance_schema_cond_instances_lost 0 |
| 48 |
Performance_schema_digest_lost 0 |
| 49 |
Performance_schema_file_classes_lost 0 |
| 50 |
Performance_schema_file_handles_lost 0 |
| 51 |
Performance_schema_file_instances_lost 0 |
| 52 |
Performance_schema_hosts_lost 0 |
| 53 |
Performance_schema_index_stat_lost 0 |
| 54 |
Performance_schema_locker_lost 0 |
| 55 |
Performance_schema_memory_classes_lost 0 |
| 56 |
Performance_schema_metadata_lock_lost 0 |
| 57 |
Performance_schema_mutex_classes_lost 0 |
| 58 |
Performance_schema_mutex_instances_lost 0 |
| 59 |
Performance_schema_nested_statement_lost 0 |
| 60 |
Performance_schema_prepared_statements_lost 0 |
| 61 |
Performance_schema_program_lost 0 |
| 62 |
Performance_schema_rwlock_classes_lost 0 |
| 63 |
Performance_schema_rwlock_instances_lost 0 |
| 64 |
Performance_schema_session_connect_attrs_lost 0 |
| 65 |
Performance_schema_socket_classes_lost 0 |
| 66 |
Performance_schema_socket_instances_lost 0 |
| 67 |
Performance_schema_stage_classes_lost 0 |
| 68 |
Performance_schema_statement_classes_lost 0 |
| 69 |
Performance_schema_table_handles_lost 0 |
| 70 |
Performance_schema_table_instances_lost 0 |
| 71 |
Performance_schema_table_lock_stat_lost 0 |
| 72 |
Performance_schema_thread_classes_lost 0 |
| 73 |
Performance_schema_thread_instances_lost 0 |
| 74 |
Performance_schema_users_lost 0 |
| 75 |
select * from ( |
| 76 |
( |
| 77 |
select (event_id - @marker_begin) as relative_event_id, |
| 78 |
(end_event_id - @marker_begin) as relative_end_event_id, |
| 79 |
event_name, |
| 80 |
sql_text as comment, |
| 81 |
nesting_event_type, |
| 82 |
(nesting_event_id - @marker_begin) as relative_nesting_event_id |
| 83 |
from performance_schema.events_statements_history_long |
| 84 |
where (thread_id = @con1_tid) |
| 85 |
and (@marker_begin <= event_id) |
| 86 |
and (end_event_id <= @marker_end) |
| 87 |
) |
| 88 |
union |
| 89 |
( |
| 90 |
select (event_id - @marker_begin) as relative_event_id, |
| 91 |
(end_event_id - @marker_begin) as relative_end_event_id, |
| 92 |
event_name, |
| 93 |
"(stage)" as comment, |
| 94 |
nesting_event_type, |
| 95 |
(nesting_event_id - @marker_begin) as relative_nesting_event_id |
| 96 |
from performance_schema.events_stages_history_long |
| 97 |
where (thread_id = @con1_tid) |
| 98 |
and (@marker_begin <= event_id) |
| 99 |
and (end_event_id <= @marker_end) |
| 100 |
) |
| 101 |
union |
| 102 |
( |
| 103 |
select (event_id - @marker_begin) as relative_event_id, |
| 104 |
(end_event_id - @marker_begin) as relative_end_event_id, |
| 105 |
event_name, |
| 106 |
operation as comment, |
| 107 |
nesting_event_type, |
| 108 |
(nesting_event_id - @marker_begin) as relative_nesting_event_id |
| 109 |
from performance_schema.events_waits_history_long |
| 110 |
where (thread_id = @con1_tid) |
| 111 |
and (@marker_begin <= event_id) |
| 112 |
and (end_event_id <= @marker_end) |
| 113 |
) |
| 114 |
) all_events |
| 115 |
order by relative_event_id asc; |
| 116 |
relative_event_id relative_end_event_id event_name comment nesting_event_type relative_nesting_event_id |
| 117 |
0 21 statement/sql/select select "MARKER_BEGIN" as marker NULL NULL |
| 118 |
1 5 stage/sql/starting (stage) STATEMENT 0 |
| 119 |
2 2 wait/io/socket/sql/client_connection recv STAGE 1 |
| 120 |
3 3 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1 |
| 121 |
4 4 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 1 |
| 122 |
5 5 wait/io/file/sql/query_log write STAGE 1 |
| 123 |
6 6 stage/sql/checking permissions (stage) STATEMENT 0 |
| 124 |
7 7 stage/sql/Opening tables (stage) STATEMENT 0 |
| 125 |
8 8 stage/sql/After opening tables (stage) STATEMENT 0 |
| 126 |
9 9 stage/sql/init (stage) STATEMENT 0 |
| 127 |
10 10 stage/sql/Optimizing (stage) STATEMENT 0 |
| 128 |
11 11 stage/sql/Executing (stage) STATEMENT 0 |
| 129 |
12 12 stage/sql/End of update loop (stage) STATEMENT 0 |
| 130 |
13 14 stage/sql/Query end (stage) STATEMENT 0 |
| 131 |
14 14 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 13 |
| 132 |
15 15 stage/sql/closing tables (stage) STATEMENT 0 |
| 133 |
16 16 stage/sql/Query end (stage) STATEMENT 0 |
| 134 |
17 17 stage/sql/Starting cleanup (stage) STATEMENT 0 |
| 135 |
18 18 stage/sql/Freeing items (stage) STATEMENT 0 |
| 136 |
19 19 wait/io/socket/sql/client_connection send STATEMENT 0 |
| 137 |
20 21 stage/sql/Reset for next command (stage) STATEMENT 0 |
| 138 |
21 21 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 20 |
| 139 |
22 22 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 0 |
| 140 |
23 23 idle idle NULL NULL |
| 141 |
24 45 statement/sql/select select "This is simple statement one" as payload NULL NULL |
| 142 |
25 29 stage/sql/starting (stage) STATEMENT 24 |
| 143 |
26 26 wait/io/socket/sql/client_connection recv STAGE 25 |
| 144 |
27 27 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 25 |
| 145 |
28 28 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 25 |
| 146 |
29 29 wait/io/file/sql/query_log write STAGE 25 |
| 147 |
30 30 stage/sql/checking permissions (stage) STATEMENT 24 |
| 148 |
31 31 stage/sql/Opening tables (stage) STATEMENT 24 |
| 149 |
32 32 stage/sql/After opening tables (stage) STATEMENT 24 |
| 150 |
33 33 stage/sql/init (stage) STATEMENT 24 |
| 151 |
34 34 stage/sql/Optimizing (stage) STATEMENT 24 |
| 152 |
35 35 stage/sql/Executing (stage) STATEMENT 24 |
| 153 |
36 36 stage/sql/End of update loop (stage) STATEMENT 24 |
| 154 |
37 38 stage/sql/Query end (stage) STATEMENT 24 |
| 155 |
38 38 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 37 |
| 156 |
39 39 stage/sql/closing tables (stage) STATEMENT 24 |
| 157 |
40 40 stage/sql/Query end (stage) STATEMENT 24 |
| 158 |
41 41 stage/sql/Starting cleanup (stage) STATEMENT 24 |
| 159 |
42 42 stage/sql/Freeing items (stage) STATEMENT 24 |
| 160 |
43 43 wait/io/socket/sql/client_connection send STATEMENT 24 |
| 161 |
44 45 stage/sql/Reset for next command (stage) STATEMENT 24 |
| 162 |
45 45 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 44 |
| 163 |
46 46 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 24 |
| 164 |
47 47 idle idle NULL NULL |
| 165 |
48 69 statement/sql/select select "This is simple statement two" as payload NULL NULL |
| 166 |
49 53 stage/sql/starting (stage) STATEMENT 48 |
| 167 |
50 50 wait/io/socket/sql/client_connection recv STAGE 49 |
| 168 |
51 51 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 49 |
| 169 |
52 52 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 49 |
| 170 |
53 53 wait/io/file/sql/query_log write STAGE 49 |
| 171 |
54 54 stage/sql/checking permissions (stage) STATEMENT 48 |
| 172 |
55 55 stage/sql/Opening tables (stage) STATEMENT 48 |
| 173 |
56 56 stage/sql/After opening tables (stage) STATEMENT 48 |
| 174 |
57 57 stage/sql/init (stage) STATEMENT 48 |
| 175 |
58 58 stage/sql/Optimizing (stage) STATEMENT 48 |
| 176 |
59 59 stage/sql/Executing (stage) STATEMENT 48 |
| 177 |
60 60 stage/sql/End of update loop (stage) STATEMENT 48 |
| 178 |
61 62 stage/sql/Query end (stage) STATEMENT 48 |
| 179 |
62 62 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 61 |
| 180 |
63 63 stage/sql/closing tables (stage) STATEMENT 48 |
| 181 |
64 64 stage/sql/Query end (stage) STATEMENT 48 |
| 182 |
65 65 stage/sql/Starting cleanup (stage) STATEMENT 48 |
| 183 |
66 66 stage/sql/Freeing items (stage) STATEMENT 48 |
| 184 |
67 67 wait/io/socket/sql/client_connection send STATEMENT 48 |
| 185 |
68 69 stage/sql/Reset for next command (stage) STATEMENT 48 |
| 186 |
69 69 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 68 |
| 187 |
70 70 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 48 |
| 188 |
71 71 idle idle NULL NULL |
| 189 |
72 92 statement/sql/select select "This is the first part of a multi query" as payload; |
| 190 |
select "And this is the second part of a multi query" as payload; |
| 191 |
select "With a third part to make things complete" as payload NULL NULL |
| 192 |
73 78 stage/sql/starting (stage) STATEMENT 72 |
| 193 |
74 74 wait/io/socket/sql/client_connection recv STAGE 73 |
| 194 |
75 75 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 |
| 195 |
76 76 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 |
| 196 |
77 77 wait/io/file/sql/query_log write STAGE 73 |
| 197 |
78 78 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 73 |
| 198 |
79 79 stage/sql/checking permissions (stage) STATEMENT 72 |
| 199 |
80 80 stage/sql/Opening tables (stage) STATEMENT 72 |
| 200 |
81 81 stage/sql/After opening tables (stage) STATEMENT 72 |
| 201 |
82 82 stage/sql/init (stage) STATEMENT 72 |
| 202 |
83 83 stage/sql/Optimizing (stage) STATEMENT 72 |
| 203 |
84 84 stage/sql/Executing (stage) STATEMENT 72 |
| 204 |
85 85 stage/sql/End of update loop (stage) STATEMENT 72 |
| 205 |
86 87 stage/sql/Query end (stage) STATEMENT 72 |
| 206 |
87 87 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 86 |
| 207 |
88 88 stage/sql/closing tables (stage) STATEMENT 72 |
| 208 |
89 89 stage/sql/Query end (stage) STATEMENT 72 |
| 209 |
90 90 stage/sql/Starting cleanup (stage) STATEMENT 72 |
| 210 |
91 92 stage/sql/Freeing items (stage) STATEMENT 72 |
| 211 |
92 92 wait/io/socket/sql/client_connection send STAGE 91 |
| 212 |
93 110 statement/sql/select select "And this is the second part of a multi query" as payload; |
| 213 |
select "With a third part to make things complete" as payload NULL NULL |
| 214 |
94 96 stage/sql/starting (stage) STATEMENT 93 |
| 215 |
95 95 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 94 |
| 216 |
96 96 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 94 |
| 217 |
97 97 stage/sql/checking permissions (stage) STATEMENT 93 |
| 218 |
98 98 stage/sql/Opening tables (stage) STATEMENT 93 |
| 219 |
99 99 stage/sql/After opening tables (stage) STATEMENT 93 |
| 220 |
100 100 stage/sql/init (stage) STATEMENT 93 |
| 221 |
101 101 stage/sql/Optimizing (stage) STATEMENT 93 |
| 222 |
102 102 stage/sql/Executing (stage) STATEMENT 93 |
| 223 |
103 103 stage/sql/End of update loop (stage) STATEMENT 93 |
| 224 |
104 105 stage/sql/Query end (stage) STATEMENT 93 |
| 225 |
105 105 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 104 |
| 226 |
106 106 stage/sql/closing tables (stage) STATEMENT 93 |
| 227 |
107 107 stage/sql/Query end (stage) STATEMENT 93 |
| 228 |
108 108 stage/sql/Starting cleanup (stage) STATEMENT 93 |
| 229 |
109 110 stage/sql/Freeing items (stage) STATEMENT 93 |
| 230 |
110 110 wait/io/socket/sql/client_connection send STAGE 109 |
| 231 |
111 129 statement/sql/select select "With a third part to make things complete" as payload NULL NULL |
| 232 |
112 113 stage/sql/starting (stage) STATEMENT 111 |
| 233 |
113 113 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 112 |
| 234 |
114 114 stage/sql/checking permissions (stage) STATEMENT 111 |
| 235 |
115 115 stage/sql/Opening tables (stage) STATEMENT 111 |
| 236 |
116 116 stage/sql/After opening tables (stage) STATEMENT 111 |
| 237 |
117 117 stage/sql/init (stage) STATEMENT 111 |
| 238 |
118 118 stage/sql/Optimizing (stage) STATEMENT 111 |
| 239 |
119 119 stage/sql/Executing (stage) STATEMENT 111 |
| 240 |
120 120 stage/sql/End of update loop (stage) STATEMENT 111 |
| 241 |
121 122 stage/sql/Query end (stage) STATEMENT 111 |
| 242 |
122 122 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 121 |
| 243 |
123 123 stage/sql/closing tables (stage) STATEMENT 111 |
| 244 |
124 124 stage/sql/Query end (stage) STATEMENT 111 |
| 245 |
125 125 stage/sql/Starting cleanup (stage) STATEMENT 111 |
| 246 |
126 126 stage/sql/Freeing items (stage) STATEMENT 111 |
| 247 |
127 127 wait/io/socket/sql/client_connection send STATEMENT 111 |
| 248 |
128 129 stage/sql/Reset for next command (stage) STATEMENT 111 |
| 249 |
129 129 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 128 |
| 250 |
130 130 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 111 |
| 251 |
131 131 idle idle NULL NULL |
| 252 |
132 153 statement/sql/select select "MARKER_END" as marker NULL NULL |
| 253 |
133 137 stage/sql/starting (stage) STATEMENT 132 |
| 254 |
134 134 wait/io/socket/sql/client_connection recv STAGE 133 |
| 255 |
135 135 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 133 |
| 256 |
136 136 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 133 |
| 257 |
137 137 wait/io/file/sql/query_log write STAGE 133 |
| 258 |
138 138 stage/sql/checking permissions (stage) STATEMENT 132 |
| 259 |
139 139 stage/sql/Opening tables (stage) STATEMENT 132 |
| 260 |
140 140 stage/sql/After opening tables (stage) STATEMENT 132 |
| 261 |
141 141 stage/sql/init (stage) STATEMENT 132 |
| 262 |
142 142 stage/sql/Optimizing (stage) STATEMENT 132 |
| 263 |
143 143 stage/sql/Executing (stage) STATEMENT 132 |
| 264 |
144 144 stage/sql/End of update loop (stage) STATEMENT 132 |
| 265 |
145 146 stage/sql/Query end (stage) STATEMENT 132 |
| 266 |
146 146 wait/synch/mutex/sql/THD::LOCK_thd_kill lock STAGE 145 |
| 267 |
147 147 stage/sql/closing tables (stage) STATEMENT 132 |
| 268 |
148 148 stage/sql/Query end (stage) STATEMENT 132 |
| 269 |
149 149 stage/sql/Starting cleanup (stage) STATEMENT 132 |
| 270 |
150 150 stage/sql/Freeing items (stage) STATEMENT 132 |
| 271 |
151 151 wait/io/socket/sql/client_connection send STATEMENT 132 |
| 272 |
152 153 stage/sql/Reset for next command (stage) STATEMENT 132 |
| 273 |
153 153 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 152 |
| 274 |
disconnect con1; |