Debian Codegraph @

mysql-test/suite/perfschema/r/threads_history.result

raw
1 create user user1@localhost;
2 create user user2@localhost;
3 create user user3@localhost;
4 create user user4@localhost;
5 grant ALL on *.* to user1@localhost;
6 grant ALL on *.* to user2@localhost;
7 grant ALL on *.* to user3@localhost;
8 grant ALL on *.* to user4@localhost;
9 flush privileges;
10 select * from performance_schema.setup_consumers;
11 NAME ENABLED
12 events_stages_current YES
13 events_stages_history YES
14 events_stages_history_long YES
15 events_statements_current YES
16 events_statements_history YES
17 events_statements_history_long YES
18 events_transactions_current YES
19 events_transactions_history YES
20 events_transactions_history_long YES
21 events_waits_current YES
22 events_waits_history YES
23 events_waits_history_long YES
24 global_instrumentation YES
25 thread_instrumentation YES
26 statements_digest YES
27 connect con1, localhost, user1, , ;
28 update performance_schema.threads
29 set INSTRUMENTED='YES', HISTORY='YES'
30 where PROCESSLIST_ID = connection_id();
31 connect con2, localhost, user2, , ;
32 update performance_schema.threads
33 set INSTRUMENTED='YES', HISTORY='NO'
34 where PROCESSLIST_ID = connection_id();
35 connect con3, localhost, user3, , ;
36 update performance_schema.threads
37 set INSTRUMENTED='NO', HISTORY='YES'
38 where PROCESSLIST_ID = connection_id();
39 connect con4, localhost, user4, , ;
40 update performance_schema.threads
41 set INSTRUMENTED='NO', HISTORY='NO'
42 where PROCESSLIST_ID = connection_id();
43 connection default;
44 truncate table performance_schema.events_transactions_current;
45 truncate table performance_schema.events_transactions_history;
46 truncate table performance_schema.events_transactions_history_long;
47 truncate table performance_schema.events_statements_current;
48 truncate table performance_schema.events_statements_history;
49 truncate table performance_schema.events_statements_history_long;
50 truncate table performance_schema.events_stages_current;
51 truncate table performance_schema.events_stages_history;
52 truncate table performance_schema.events_stages_history_long;
53 truncate table performance_schema.events_waits_current;
54 truncate table performance_schema.events_waits_history;
55 truncate table performance_schema.events_waits_history_long;
56 connection con1;
57 XA START 'XA_CON1', 'XA_BQUAL', 12;
58 select "Hi from con1";
59 Hi from con1
60 Hi from con1
61 XA END 'XA_CON1', 'XA_BQUAL', 12;
62 XA PREPARE 'XA_CON1', 'XA_BQUAL', 12;
63 XA COMMIT 'XA_CON1', 'XA_BQUAL', 12;
64 connection con2;
65 XA START 'XA_CON2', 'XA_BQUAL', 12;
66 select "Hi from con2";
67 Hi from con2
68 Hi from con2
69 XA END 'XA_CON2', 'XA_BQUAL', 12;
70 XA PREPARE 'XA_CON2', 'XA_BQUAL', 12;
71 XA COMMIT 'XA_CON2', 'XA_BQUAL', 12;
72 connection con3;
73 XA START 'XA_CON3', 'XA_BQUAL', 12;
74 select "Hi from con3";
75 Hi from con3
76 Hi from con3
77 XA END 'XA_CON3', 'XA_BQUAL', 12;
78 XA PREPARE 'XA_CON3', 'XA_BQUAL', 12;
79 XA COMMIT 'XA_CON3', 'XA_BQUAL', 12;
80 connection con4;
81 XA START 'XA_CON4', 'XA_BQUAL', 12;
82 select "Hi from con4";
83 Hi from con4
84 Hi from con4
85 XA END 'XA_CON4', 'XA_BQUAL', 12;
86 XA PREPARE 'XA_CON4', 'XA_BQUAL', 12;
87 XA COMMIT 'XA_CON4', 'XA_BQUAL', 12;
88 connection default;
89 ########################### Transactions user 1 - 1
90 select /*1-1*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_current
91 where THREAD_ID = $con1_thread_id;
92 XID_FORMAT_ID XID_GTRID XID_BQUAL
93 12 XA_CON1 XA_BQUAL
94 select /*1-1*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_history
95 where THREAD_ID = $con1_thread_id;
96 XID_FORMAT_ID XID_GTRID XID_BQUAL
97 12 XA_CON1 XA_BQUAL
98 select /*1-1*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_history_long
99 where THREAD_ID = $con1_thread_id;
100 XID_FORMAT_ID XID_GTRID XID_BQUAL
101 12 XA_CON1 XA_BQUAL
102 ########################### Transactions user 2 - 1
103 select /*2-1*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_current
104 where THREAD_ID = $con2_thread_id;
105 XID_FORMAT_ID XID_GTRID XID_BQUAL
106 12 XA_CON2 XA_BQUAL
107 select /*2-1*/ count(*) from performance_schema.events_transactions_history
108 where THREAD_ID = $con2_thread_id;
109 count(*)
110 0
111 select /*2-1*/ count(*) from performance_schema.events_transactions_history_long
112 where THREAD_ID = $con2_thread_id;
113 count(*)
114 0
115 ########################### Transactions user 3 - 1
116 select /*3-1*/ count(*) from performance_schema.events_transactions_current
117 where THREAD_ID = $con3_thread_id;
118 count(*)
119 0
120 select /*3-1*/ count(*) from performance_schema.events_transactions_history
121 where THREAD_ID = $con3_thread_id;
122 count(*)
123 0
124 select /*3-1*/ count(*) from performance_schema.events_transactions_history_long
125 where THREAD_ID = $con3_thread_id;
126 count(*)
127 0
128 ########################### Transactions user 4 - 1
129 select /*4-1*/ count(*) from performance_schema.events_transactions_current
130 where THREAD_ID = $con4_thread_id;
131 count(*)
132 0
133 select /*4-1*/ count(*) from performance_schema.events_transactions_history
134 where THREAD_ID = $con4_thread_id;
135 count(*)
136 0
137 select /*4-1*/ count(*) from performance_schema.events_transactions_history_long
138 where THREAD_ID = $con4_thread_id;
139 count(*)
140 0
141 ########################### Statements user 1 - 1
142 select /*1-1*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_current
143 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
144 EVENT_NAME SQL_TEXT
145 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
146 select /*1-1*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_history
147 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
148 EVENT_NAME SQL_TEXT
149 statement/sql/xa_start XA START 'XA_CON1', 'XA_BQUAL', 12
150 statement/sql/select select "Hi from con1"
151 statement/sql/xa_end XA END 'XA_CON1', 'XA_BQUAL', 12
152 statement/sql/xa_prepare XA PREPARE 'XA_CON1', 'XA_BQUAL', 12
153 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
154 select /*1-1*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_history_long
155 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
156 EVENT_NAME SQL_TEXT
157 statement/sql/xa_start XA START 'XA_CON1', 'XA_BQUAL', 12
158 statement/sql/select select "Hi from con1"
159 statement/sql/xa_end XA END 'XA_CON1', 'XA_BQUAL', 12
160 statement/sql/xa_prepare XA PREPARE 'XA_CON1', 'XA_BQUAL', 12
161 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
162 ########################### Statements user 2 - 1
163 select /*2-1*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_current
164 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
165 EVENT_NAME SQL_TEXT
166 statement/sql/xa_commit XA COMMIT 'XA_CON2', 'XA_BQUAL', 12
167 select /*2-1*/ count(*) from performance_schema.events_statements_history
168 where THREAD_ID = $con2_thread_id;
169 count(*)
170 0
171 select /*2-1*/ count(*) from performance_schema.events_statements_history_long
172 where THREAD_ID = $con2_thread_id;
173 count(*)
174 0
175 ########################### Statements user 3 - 1
176 select /*3-1*/ count(*) from performance_schema.events_statements_current
177 where THREAD_ID = $con3_thread_id;
178 count(*)
179 0
180 select /*3-1*/ count(*) from performance_schema.events_statements_history
181 where THREAD_ID = $con3_thread_id;
182 count(*)
183 0
184 select /*3-1*/ count(*) from performance_schema.events_statements_history_long
185 where THREAD_ID = $con3_thread_id;
186 count(*)
187 0
188 ########################### Statements user 4 - 1
189 select /*4-1*/ count(*) from performance_schema.events_statements_current
190 where THREAD_ID = $con4_thread_id;
191 count(*)
192 0
193 select /*4-1*/ count(*) from performance_schema.events_statements_history
194 where THREAD_ID = $con4_thread_id;
195 count(*)
196 0
197 select /*4-1*/ count(*) from performance_schema.events_statements_history_long
198 where THREAD_ID = $con4_thread_id;
199 count(*)
200 0
201 ########################### Stages user 1 - 1
202 select /*1-1*/ EVENT_NAME from performance_schema.events_stages_current
203 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
204 EVENT_NAME
205 select /*1-1*/ EVENT_NAME from performance_schema.events_stages_history
206 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
207 EVENT_NAME
208 stage/sql/Starting cleanup
209 stage/sql/Freeing items
210 stage/sql/Reset for next command
211 stage/sql/starting
212 stage/sql/Query end
213 stage/sql/closing tables
214 stage/sql/Query end
215 stage/sql/Starting cleanup
216 stage/sql/Freeing items
217 stage/sql/Reset for next command
218 select /*1-1*/ EVENT_NAME from performance_schema.events_stages_history_long
219 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
220 EVENT_NAME
221 stage/sql/starting
222 stage/sql/Query end
223 stage/sql/closing tables
224 stage/sql/Query end
225 stage/sql/Starting cleanup
226 stage/sql/Freeing items
227 stage/sql/Reset for next command
228 stage/sql/starting
229 stage/sql/checking permissions
230 stage/sql/Opening tables
231 stage/sql/After opening tables
232 stage/sql/init
233 stage/sql/Optimizing
234 stage/sql/Executing
235 stage/sql/End of update loop
236 stage/sql/Query end
237 stage/sql/closing tables
238 stage/sql/Query end
239 stage/sql/Starting cleanup
240 stage/sql/Freeing items
241 stage/sql/Reset for next command
242 stage/sql/starting
243 stage/sql/Query end
244 stage/sql/closing tables
245 stage/sql/Query end
246 stage/sql/Starting cleanup
247 stage/sql/Freeing items
248 stage/sql/Reset for next command
249 stage/sql/starting
250 stage/sql/Query end
251 stage/sql/closing tables
252 stage/sql/Query end
253 stage/sql/Starting cleanup
254 stage/sql/Freeing items
255 stage/sql/Reset for next command
256 stage/sql/starting
257 stage/sql/Query end
258 stage/sql/closing tables
259 stage/sql/Query end
260 stage/sql/Starting cleanup
261 stage/sql/Freeing items
262 stage/sql/Reset for next command
263 ########################### Stages user 2 - 1
264 select /*2-1*/ EVENT_NAME from performance_schema.events_stages_current
265 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
266 EVENT_NAME
267 select /*2-1*/ count(*) from performance_schema.events_stages_history
268 where THREAD_ID = $con2_thread_id;
269 count(*)
270 0
271 select /*2-1*/ count(*) from performance_schema.events_stages_history_long
272 where THREAD_ID = $con2_thread_id;
273 count(*)
274 0
275 ########################### Stages user 3 - 1
276 select /*3-1*/ count(*) from performance_schema.events_stages_current
277 where THREAD_ID = $con3_thread_id;
278 count(*)
279 0
280 select /*3-1*/ count(*) from performance_schema.events_stages_history
281 where THREAD_ID = $con3_thread_id;
282 count(*)
283 0
284 select /*3-1*/ count(*) from performance_schema.events_stages_history_long
285 where THREAD_ID = $con3_thread_id;
286 count(*)
287 0
288 ########################### Stages user 4 - 1
289 select /*4-1*/ count(*) from performance_schema.events_stages_current
290 where THREAD_ID = $con4_thread_id;
291 count(*)
292 0
293 select /*4-1*/ count(*) from performance_schema.events_stages_history
294 where THREAD_ID = $con4_thread_id;
295 count(*)
296 0
297 select /*4-1*/ count(*) from performance_schema.events_stages_history_long
298 where THREAD_ID = $con4_thread_id;
299 count(*)
300 0
301 ########################### Waits user 1 - 1
302 select /*1-1*/ EVENT_NAME from performance_schema.events_waits_current
303 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
304 EVENT_NAME
305 idle
306 select /*1-1*/ (count(*) > 5) as has_waits from performance_schema.events_waits_history
307 where THREAD_ID = $con1_thread_id;
308 has_waits
309 1
310 select /*1-1*/ (count(*) > 15) as has_waits from performance_schema.events_waits_history_long
311 where THREAD_ID = $con1_thread_id;
312 has_waits
313 1
314 ########################### Waits user 2 - 1
315 select /*2-1*/ EVENT_NAME from performance_schema.events_waits_current
316 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
317 EVENT_NAME
318 idle
319 select /*2-1*/ count(*) from performance_schema.events_waits_history
320 where THREAD_ID = $con2_thread_id;
321 count(*)
322 0
323 select /*2-1*/ count(*) from performance_schema.events_waits_history_long
324 where THREAD_ID = $con2_thread_id;
325 count(*)
326 0
327 ########################### Waits user 3 - 1
328 select /*3-1*/ count(*) from performance_schema.events_waits_current
329 where THREAD_ID = $con3_thread_id;
330 count(*)
331 0
332 select /*3-1*/ count(*) from performance_schema.events_waits_history
333 where THREAD_ID = $con3_thread_id;
334 count(*)
335 0
336 select /*3-1*/ count(*) from performance_schema.events_waits_history_long
337 where THREAD_ID = $con3_thread_id;
338 count(*)
339 0
340 ########################### Waits user 4 - 1
341 select /*4-1*/ count(*) from performance_schema.events_waits_current
342 where THREAD_ID = $con4_thread_id;
343 count(*)
344 0
345 select /*4-1*/ count(*) from performance_schema.events_waits_history
346 where THREAD_ID = $con4_thread_id;
347 count(*)
348 0
349 select /*4-1*/ count(*) from performance_schema.events_waits_history_long
350 where THREAD_ID = $con4_thread_id;
351 count(*)
352 0
353 connection default;
354 update performance_schema.setup_consumers
355 set enabled='NO' where name like "%history%";
356 select * from performance_schema.setup_consumers;
357 NAME ENABLED
358 events_stages_current YES
359 events_stages_history NO
360 events_stages_history_long NO
361 events_statements_current YES
362 events_statements_history NO
363 events_statements_history_long NO
364 events_transactions_current YES
365 events_transactions_history NO
366 events_transactions_history_long NO
367 events_waits_current YES
368 events_waits_history NO
369 events_waits_history_long NO
370 global_instrumentation YES
371 thread_instrumentation YES
372 statements_digest YES
373 truncate table performance_schema.events_transactions_current;
374 truncate table performance_schema.events_transactions_history;
375 truncate table performance_schema.events_transactions_history_long;
376 truncate table performance_schema.events_statements_current;
377 truncate table performance_schema.events_statements_history;
378 truncate table performance_schema.events_statements_history_long;
379 truncate table performance_schema.events_stages_current;
380 truncate table performance_schema.events_stages_history;
381 truncate table performance_schema.events_stages_history_long;
382 truncate table performance_schema.events_waits_current;
383 truncate table performance_schema.events_waits_history;
384 truncate table performance_schema.events_waits_history_long;
385 connection con1;
386 XA START 'XA_CON1', 'XA_BQUAL', 12;
387 select "Hi from con1";
388 Hi from con1
389 Hi from con1
390 XA END 'XA_CON1', 'XA_BQUAL', 12;
391 XA PREPARE 'XA_CON1', 'XA_BQUAL', 12;
392 XA COMMIT 'XA_CON1', 'XA_BQUAL', 12;
393 connection con2;
394 XA START 'XA_CON2', 'XA_BQUAL', 12;
395 select "Hi from con2";
396 Hi from con2
397 Hi from con2
398 XA END 'XA_CON2', 'XA_BQUAL', 12;
399 XA PREPARE 'XA_CON2', 'XA_BQUAL', 12;
400 XA COMMIT 'XA_CON2', 'XA_BQUAL', 12;
401 connection con3;
402 XA START 'XA_CON3', 'XA_BQUAL', 12;
403 select "Hi from con3";
404 Hi from con3
405 Hi from con3
406 XA END 'XA_CON3', 'XA_BQUAL', 12;
407 XA PREPARE 'XA_CON3', 'XA_BQUAL', 12;
408 XA COMMIT 'XA_CON3', 'XA_BQUAL', 12;
409 connection con4;
410 XA START 'XA_CON4', 'XA_BQUAL', 12;
411 select "Hi from con4";
412 Hi from con4
413 Hi from con4
414 XA END 'XA_CON4', 'XA_BQUAL', 12;
415 XA PREPARE 'XA_CON4', 'XA_BQUAL', 12;
416 XA COMMIT 'XA_CON4', 'XA_BQUAL', 12;
417 connection default;
418 ########################### Transactions user 1 - 2
419 select /*1-2*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_current
420 where THREAD_ID = $con1_thread_id;
421 XID_FORMAT_ID XID_GTRID XID_BQUAL
422 12 XA_CON1 XA_BQUAL
423 select /*1-2*/ count(*) from performance_schema.events_transactions_history
424 where THREAD_ID = $con1_thread_id;
425 count(*)
426 0
427 select /*1-2*/ count(*) from performance_schema.events_transactions_history_long
428 where THREAD_ID = $con1_thread_id;
429 count(*)
430 0
431 ########################### Transactions user 2 - 2
432 select /*2-2*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_current
433 where THREAD_ID = $con2_thread_id;
434 XID_FORMAT_ID XID_GTRID XID_BQUAL
435 12 XA_CON2 XA_BQUAL
436 select /*2-2*/ count(*) from performance_schema.events_transactions_history
437 where THREAD_ID = $con2_thread_id;
438 count(*)
439 0
440 select /*2-2*/ count(*) from performance_schema.events_transactions_history_long
441 where THREAD_ID = $con2_thread_id;
442 count(*)
443 0
444 ########################### Transactions user 3 - 2
445 select /*3-2*/ count(*) from performance_schema.events_transactions_current
446 where THREAD_ID = $con3_thread_id;
447 count(*)
448 0
449 select /*3-2*/ count(*) from performance_schema.events_transactions_history
450 where THREAD_ID = $con3_thread_id;
451 count(*)
452 0
453 select /*3-2*/ count(*) from performance_schema.events_transactions_history_long
454 where THREAD_ID = $con3_thread_id;
455 count(*)
456 0
457 ########################### Transactions user 4 - 2
458 select /*4-2*/ count(*) from performance_schema.events_transactions_current
459 where THREAD_ID = $con4_thread_id;
460 count(*)
461 0
462 select /*4-2*/ count(*) from performance_schema.events_transactions_history
463 where THREAD_ID = $con4_thread_id;
464 count(*)
465 0
466 select /*4-2*/ count(*) from performance_schema.events_transactions_history_long
467 where THREAD_ID = $con4_thread_id;
468 count(*)
469 0
470 ########################### Statements user 1 - 2
471 select /*1-2*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_current
472 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
473 EVENT_NAME SQL_TEXT
474 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
475 select /*1-2*/ count(*) from performance_schema.events_statements_history
476 where THREAD_ID = $con1_thread_id;
477 count(*)
478 0
479 select /*1-2*/ count(*) from performance_schema.events_statements_history_long
480 where THREAD_ID = $con1_thread_id;
481 count(*)
482 0
483 ########################### Statements user 2 - 2
484 select /*2-2*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_current
485 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
486 EVENT_NAME SQL_TEXT
487 statement/sql/xa_commit XA COMMIT 'XA_CON2', 'XA_BQUAL', 12
488 select /*2-2*/ count(*) from performance_schema.events_statements_history
489 where THREAD_ID = $con2_thread_id;
490 count(*)
491 0
492 select /*2-2*/ count(*) from performance_schema.events_statements_history_long
493 where THREAD_ID = $con2_thread_id;
494 count(*)
495 0
496 ########################### Statements user 3 - 2
497 select /*3-2*/ count(*) from performance_schema.events_statements_current
498 where THREAD_ID = $con3_thread_id;
499 count(*)
500 0
501 select /*3-2*/ count(*) from performance_schema.events_statements_history
502 where THREAD_ID = $con3_thread_id;
503 count(*)
504 0
505 select /*3-2*/ count(*) from performance_schema.events_statements_history_long
506 where THREAD_ID = $con3_thread_id;
507 count(*)
508 0
509 ########################### Statements user 4 - 2
510 select /*4-2*/ count(*) from performance_schema.events_statements_current
511 where THREAD_ID = $con4_thread_id;
512 count(*)
513 0
514 select /*4-2*/ count(*) from performance_schema.events_statements_history
515 where THREAD_ID = $con4_thread_id;
516 count(*)
517 0
518 select /*4-2*/ count(*) from performance_schema.events_statements_history_long
519 where THREAD_ID = $con4_thread_id;
520 count(*)
521 0
522 ########################### Stages user 1 - 2
523 select /*1-2*/ EVENT_NAME from performance_schema.events_stages_current
524 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
525 EVENT_NAME
526 select /*1-2*/ count(*) from performance_schema.events_stages_history
527 where THREAD_ID = $con1_thread_id;
528 count(*)
529 0
530 select /*1-2*/ count(*) from performance_schema.events_stages_history_long
531 where THREAD_ID = $con1_thread_id;
532 count(*)
533 0
534 ########################### Stages user 2 - 2
535 select /*2-2*/ EVENT_NAME from performance_schema.events_stages_current
536 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
537 EVENT_NAME
538 select /*2-2*/ count(*) from performance_schema.events_stages_history
539 where THREAD_ID = $con2_thread_id;
540 count(*)
541 0
542 select /*2-2*/ count(*) from performance_schema.events_stages_history_long
543 where THREAD_ID = $con2_thread_id;
544 count(*)
545 0
546 ########################### Stages user 3 - 2
547 select /*3-2*/ count(*) from performance_schema.events_stages_current
548 where THREAD_ID = $con3_thread_id;
549 count(*)
550 0
551 select /*3-2*/ count(*) from performance_schema.events_stages_history
552 where THREAD_ID = $con3_thread_id;
553 count(*)
554 0
555 select /*3-2*/ count(*) from performance_schema.events_stages_history_long
556 where THREAD_ID = $con3_thread_id;
557 count(*)
558 0
559 ########################### Stages user 4 - 2
560 select /*4-2*/ count(*) from performance_schema.events_stages_current
561 where THREAD_ID = $con4_thread_id;
562 count(*)
563 0
564 select /*4-2*/ count(*) from performance_schema.events_stages_history
565 where THREAD_ID = $con4_thread_id;
566 count(*)
567 0
568 select /*4-2*/ count(*) from performance_schema.events_stages_history_long
569 where THREAD_ID = $con4_thread_id;
570 count(*)
571 0
572 ########################### Waits user 1 - 2
573 select /*1-2*/ EVENT_NAME from performance_schema.events_waits_current
574 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
575 EVENT_NAME
576 idle
577 select /*1-2*/ count(*) as has_waits from performance_schema.events_waits_history
578 where THREAD_ID = $con1_thread_id;
579 has_waits
580 0
581 select /*1-2*/ count(*) as has_waits from performance_schema.events_waits_history_long
582 where THREAD_ID = $con1_thread_id;
583 has_waits
584 0
585 ########################### Waits user 2 - 2
586 select /*2-2*/ EVENT_NAME from performance_schema.events_waits_current
587 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
588 EVENT_NAME
589 idle
590 select /*2-2*/ count(*) from performance_schema.events_waits_history
591 where THREAD_ID = $con2_thread_id;
592 count(*)
593 0
594 select /*2-2*/ count(*) from performance_schema.events_waits_history_long
595 where THREAD_ID = $con2_thread_id;
596 count(*)
597 0
598 ########################### Waits user 3 - 2
599 select /*3-2*/ count(*) from performance_schema.events_waits_current
600 where THREAD_ID = $con3_thread_id;
601 count(*)
602 0
603 select /*3-2*/ count(*) from performance_schema.events_waits_history
604 where THREAD_ID = $con3_thread_id;
605 count(*)
606 0
607 select /*3-2*/ count(*) from performance_schema.events_waits_history_long
608 where THREAD_ID = $con3_thread_id;
609 count(*)
610 0
611 ########################### Waits user 4 - 2
612 select /*4-2*/ count(*) from performance_schema.events_waits_current
613 where THREAD_ID = $con4_thread_id;
614 count(*)
615 0
616 select /*4-2*/ count(*) from performance_schema.events_waits_history
617 where THREAD_ID = $con4_thread_id;
618 count(*)
619 0
620 select /*4-2*/ count(*) from performance_schema.events_waits_history_long
621 where THREAD_ID = $con4_thread_id;
622 count(*)
623 0
624 connection default;
625 update performance_schema.setup_consumers
626 set enabled='YES' where name like "%history%";
627 select * from performance_schema.setup_consumers;
628 NAME ENABLED
629 events_stages_current YES
630 events_stages_history YES
631 events_stages_history_long YES
632 events_statements_current YES
633 events_statements_history YES
634 events_statements_history_long YES
635 events_transactions_current YES
636 events_transactions_history YES
637 events_transactions_history_long YES
638 events_waits_current YES
639 events_waits_history YES
640 events_waits_history_long YES
641 global_instrumentation YES
642 thread_instrumentation YES
643 statements_digest YES
644 truncate table performance_schema.events_transactions_current;
645 truncate table performance_schema.events_transactions_history;
646 truncate table performance_schema.events_transactions_history_long;
647 truncate table performance_schema.events_statements_current;
648 truncate table performance_schema.events_statements_history;
649 truncate table performance_schema.events_statements_history_long;
650 truncate table performance_schema.events_stages_current;
651 truncate table performance_schema.events_stages_history;
652 truncate table performance_schema.events_stages_history_long;
653 truncate table performance_schema.events_waits_current;
654 truncate table performance_schema.events_waits_history;
655 truncate table performance_schema.events_waits_history_long;
656 connection con1;
657 XA START 'XA_CON1', 'XA_BQUAL', 12;
658 select "Hi from con1";
659 Hi from con1
660 Hi from con1
661 XA END 'XA_CON1', 'XA_BQUAL', 12;
662 XA PREPARE 'XA_CON1', 'XA_BQUAL', 12;
663 XA COMMIT 'XA_CON1', 'XA_BQUAL', 12;
664 connection con2;
665 XA START 'XA_CON2', 'XA_BQUAL', 12;
666 select "Hi from con2";
667 Hi from con2
668 Hi from con2
669 XA END 'XA_CON2', 'XA_BQUAL', 12;
670 XA PREPARE 'XA_CON2', 'XA_BQUAL', 12;
671 XA COMMIT 'XA_CON2', 'XA_BQUAL', 12;
672 connection con3;
673 XA START 'XA_CON3', 'XA_BQUAL', 12;
674 select "Hi from con3";
675 Hi from con3
676 Hi from con3
677 XA END 'XA_CON3', 'XA_BQUAL', 12;
678 XA PREPARE 'XA_CON3', 'XA_BQUAL', 12;
679 XA COMMIT 'XA_CON3', 'XA_BQUAL', 12;
680 connection con4;
681 XA START 'XA_CON4', 'XA_BQUAL', 12;
682 select "Hi from con4";
683 Hi from con4
684 Hi from con4
685 XA END 'XA_CON4', 'XA_BQUAL', 12;
686 XA PREPARE 'XA_CON4', 'XA_BQUAL', 12;
687 XA COMMIT 'XA_CON4', 'XA_BQUAL', 12;
688 connection default;
689 ########################### Transactions user 1 - 3
690 select /*1-3*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_current
691 where THREAD_ID = $con1_thread_id;
692 XID_FORMAT_ID XID_GTRID XID_BQUAL
693 12 XA_CON1 XA_BQUAL
694 select /*1-3*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_history
695 where THREAD_ID = $con1_thread_id;
696 XID_FORMAT_ID XID_GTRID XID_BQUAL
697 12 XA_CON1 XA_BQUAL
698 select /*1-3*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_history_long
699 where THREAD_ID = $con1_thread_id;
700 XID_FORMAT_ID XID_GTRID XID_BQUAL
701 12 XA_CON1 XA_BQUAL
702 ########################### Transactions user 2 - 3
703 select /*2-3*/ XID_FORMAT_ID, XID_GTRID, XID_BQUAL from performance_schema.events_transactions_current
704 where THREAD_ID = $con2_thread_id;
705 XID_FORMAT_ID XID_GTRID XID_BQUAL
706 12 XA_CON2 XA_BQUAL
707 select /*2-3*/ count(*) from performance_schema.events_transactions_history
708 where THREAD_ID = $con2_thread_id;
709 count(*)
710 0
711 select /*2-3*/ count(*) from performance_schema.events_transactions_history_long
712 where THREAD_ID = $con2_thread_id;
713 count(*)
714 0
715 ########################### Transactions user 3 - 3
716 select /*3-3*/ count(*) from performance_schema.events_transactions_current
717 where THREAD_ID = $con3_thread_id;
718 count(*)
719 0
720 select /*3-3*/ count(*) from performance_schema.events_transactions_history
721 where THREAD_ID = $con3_thread_id;
722 count(*)
723 0
724 select /*3-3*/ count(*) from performance_schema.events_transactions_history_long
725 where THREAD_ID = $con3_thread_id;
726 count(*)
727 0
728 ########################### Transactions user 4 - 3
729 select /*4-3*/ count(*) from performance_schema.events_transactions_current
730 where THREAD_ID = $con4_thread_id;
731 count(*)
732 0
733 select /*4-3*/ count(*) from performance_schema.events_transactions_history
734 where THREAD_ID = $con4_thread_id;
735 count(*)
736 0
737 select /*4-3*/ count(*) from performance_schema.events_transactions_history_long
738 where THREAD_ID = $con4_thread_id;
739 count(*)
740 0
741 ########################### Statements user 1 - 3
742 select /*1-3*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_current
743 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
744 EVENT_NAME SQL_TEXT
745 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
746 select /*1-3*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_history
747 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
748 EVENT_NAME SQL_TEXT
749 statement/sql/xa_start XA START 'XA_CON1', 'XA_BQUAL', 12
750 statement/sql/select select "Hi from con1"
751 statement/sql/xa_end XA END 'XA_CON1', 'XA_BQUAL', 12
752 statement/sql/xa_prepare XA PREPARE 'XA_CON1', 'XA_BQUAL', 12
753 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
754 select /*1-3*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_history_long
755 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
756 EVENT_NAME SQL_TEXT
757 statement/sql/xa_start XA START 'XA_CON1', 'XA_BQUAL', 12
758 statement/sql/select select "Hi from con1"
759 statement/sql/xa_end XA END 'XA_CON1', 'XA_BQUAL', 12
760 statement/sql/xa_prepare XA PREPARE 'XA_CON1', 'XA_BQUAL', 12
761 statement/sql/xa_commit XA COMMIT 'XA_CON1', 'XA_BQUAL', 12
762 ########################### Statements user 2 - 3
763 select /*2-3*/ EVENT_NAME, SQL_TEXT from performance_schema.events_statements_current
764 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
765 EVENT_NAME SQL_TEXT
766 statement/sql/xa_commit XA COMMIT 'XA_CON2', 'XA_BQUAL', 12
767 select /*2-3*/ count(*) from performance_schema.events_statements_history
768 where THREAD_ID = $con2_thread_id;
769 count(*)
770 0
771 select /*2-3*/ count(*) from performance_schema.events_statements_history_long
772 where THREAD_ID = $con2_thread_id;
773 count(*)
774 0
775 ########################### Statements user 3 - 3
776 select /*3-3*/ count(*) from performance_schema.events_statements_current
777 where THREAD_ID = $con3_thread_id;
778 count(*)
779 0
780 select /*3-3*/ count(*) from performance_schema.events_statements_history
781 where THREAD_ID = $con3_thread_id;
782 count(*)
783 0
784 select /*3-3*/ count(*) from performance_schema.events_statements_history_long
785 where THREAD_ID = $con3_thread_id;
786 count(*)
787 0
788 ########################### Statements user 4 - 3
789 select /*4-3*/ count(*) from performance_schema.events_statements_current
790 where THREAD_ID = $con4_thread_id;
791 count(*)
792 0
793 select /*4-3*/ count(*) from performance_schema.events_statements_history
794 where THREAD_ID = $con4_thread_id;
795 count(*)
796 0
797 select /*4-3*/ count(*) from performance_schema.events_statements_history_long
798 where THREAD_ID = $con4_thread_id;
799 count(*)
800 0
801 ########################### Stages user 1 - 3
802 select /*1-3*/ EVENT_NAME from performance_schema.events_stages_current
803 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
804 EVENT_NAME
805 select /*1-3*/ EVENT_NAME from performance_schema.events_stages_history
806 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
807 EVENT_NAME
808 stage/sql/Starting cleanup
809 stage/sql/Freeing items
810 stage/sql/Reset for next command
811 stage/sql/starting
812 stage/sql/Query end
813 stage/sql/closing tables
814 stage/sql/Query end
815 stage/sql/Starting cleanup
816 stage/sql/Freeing items
817 stage/sql/Reset for next command
818 select /*1-3*/ EVENT_NAME from performance_schema.events_stages_history_long
819 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
820 EVENT_NAME
821 stage/sql/starting
822 stage/sql/Query end
823 stage/sql/closing tables
824 stage/sql/Query end
825 stage/sql/Starting cleanup
826 stage/sql/Freeing items
827 stage/sql/Reset for next command
828 stage/sql/starting
829 stage/sql/checking permissions
830 stage/sql/Opening tables
831 stage/sql/After opening tables
832 stage/sql/init
833 stage/sql/Optimizing
834 stage/sql/Executing
835 stage/sql/End of update loop
836 stage/sql/Query end
837 stage/sql/closing tables
838 stage/sql/Query end
839 stage/sql/Starting cleanup
840 stage/sql/Freeing items
841 stage/sql/Reset for next command
842 stage/sql/starting
843 stage/sql/Query end
844 stage/sql/closing tables
845 stage/sql/Query end
846 stage/sql/Starting cleanup
847 stage/sql/Freeing items
848 stage/sql/Reset for next command
849 stage/sql/starting
850 stage/sql/Query end
851 stage/sql/closing tables
852 stage/sql/Query end
853 stage/sql/Starting cleanup
854 stage/sql/Freeing items
855 stage/sql/Reset for next command
856 stage/sql/starting
857 stage/sql/Query end
858 stage/sql/closing tables
859 stage/sql/Query end
860 stage/sql/Starting cleanup
861 stage/sql/Freeing items
862 stage/sql/Reset for next command
863 ########################### Stages user 2 - 3
864 select /*2-3*/ EVENT_NAME from performance_schema.events_stages_current
865 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
866 EVENT_NAME
867 select /*2-3*/ count(*) from performance_schema.events_stages_history
868 where THREAD_ID = $con2_thread_id;
869 count(*)
870 0
871 select /*2-3*/ count(*) from performance_schema.events_stages_history_long
872 where THREAD_ID = $con2_thread_id;
873 count(*)
874 0
875 ########################### Stages user 3 - 3
876 select /*3-3*/ count(*) from performance_schema.events_stages_current
877 where THREAD_ID = $con3_thread_id;
878 count(*)
879 0
880 select /*3-3*/ count(*) from performance_schema.events_stages_history
881 where THREAD_ID = $con3_thread_id;
882 count(*)
883 0
884 select /*3-3*/ count(*) from performance_schema.events_stages_history_long
885 where THREAD_ID = $con3_thread_id;
886 count(*)
887 0
888 ########################### Stages user 4 - 3
889 select /*4-3*/ count(*) from performance_schema.events_stages_current
890 where THREAD_ID = $con4_thread_id;
891 count(*)
892 0
893 select /*4-3*/ count(*) from performance_schema.events_stages_history
894 where THREAD_ID = $con4_thread_id;
895 count(*)
896 0
897 select /*4-3*/ count(*) from performance_schema.events_stages_history_long
898 where THREAD_ID = $con4_thread_id;
899 count(*)
900 0
901 ########################### Waits user 1 - 3
902 select /*1-3*/ EVENT_NAME from performance_schema.events_waits_current
903 where THREAD_ID = $con1_thread_id order by THREAD_ID, EVENT_ID;
904 EVENT_NAME
905 idle
906 select /*1-3*/ (count(*) > 5) as has_waits from performance_schema.events_waits_history
907 where THREAD_ID = $con1_thread_id;
908 has_waits
909 1
910 select /*1-3*/ (count(*) > 15) as has_waits from performance_schema.events_waits_history_long
911 where THREAD_ID = $con1_thread_id;
912 has_waits
913 1
914 ########################### Waits user 2 - 3
915 select /*2-3*/ EVENT_NAME from performance_schema.events_waits_current
916 where THREAD_ID = $con2_thread_id order by THREAD_ID, EVENT_ID;
917 EVENT_NAME
918 idle
919 select /*2-3*/ count(*) from performance_schema.events_waits_history
920 where THREAD_ID = $con2_thread_id;
921 count(*)
922 0
923 select /*2-3*/ count(*) from performance_schema.events_waits_history_long
924 where THREAD_ID = $con2_thread_id;
925 count(*)
926 0
927 ########################### Waits user 3 - 3
928 select /*3-3*/ count(*) from performance_schema.events_waits_current
929 where THREAD_ID = $con3_thread_id;
930 count(*)
931 0
932 select /*3-3*/ count(*) from performance_schema.events_waits_history
933 where THREAD_ID = $con3_thread_id;
934 count(*)
935 0
936 select /*3-3*/ count(*) from performance_schema.events_waits_history_long
937 where THREAD_ID = $con3_thread_id;
938 count(*)
939 0
940 ########################### Waits user 4 - 3
941 select /*4-3*/ count(*) from performance_schema.events_waits_current
942 where THREAD_ID = $con4_thread_id;
943 count(*)
944 0
945 select /*4-3*/ count(*) from performance_schema.events_waits_history
946 where THREAD_ID = $con4_thread_id;
947 count(*)
948 0
949 select /*4-3*/ count(*) from performance_schema.events_waits_history_long
950 where THREAD_ID = $con4_thread_id;
951 count(*)
952 0
953 connection default;
954 revoke all privileges, grant option from user1@localhost;
955 revoke all privileges, grant option from user2@localhost;
956 revoke all privileges, grant option from user3@localhost;
957 revoke all privileges, grant option from user4@localhost;
958 drop user user1@localhost;
959 drop user user2@localhost;
960 drop user user3@localhost;
961 drop user user4@localhost;
962 flush privileges;
963 truncate table performance_schema.setup_actors;
964 insert into performance_schema.setup_actors
965 values ('%', '%', '%', 'YES', 'YES');
966 select * from performance_schema.setup_actors;
967 HOST USER ROLE ENABLED HISTORY
968 % % % YES YES