Debian Codegraph @

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

raw
1 ####################################
2 # SETUP
3 ####################################
4 CREATE DATABASE statements_digest;
5 USE statements_digest;
6 CREATE TABLE t1(a int);
7 CREATE TABLE t2(a int);
8 CREATE TABLE t3(a int, b int);
9 CREATE TABLE t4(a int, b int);
10 CREATE TABLE t5(a int, b int, c int);
11 CREATE TABLE t6(a int, b int, c int, d int);
12 CREATE TABLE t11 (c CHAR(4));
13 CREATE TABLE t12 (c CHAR(4));
14 SELECT * FROM performance_schema.setup_consumers;
15 NAME ENABLED
16 events_stages_current YES
17 events_stages_history YES
18 events_stages_history_long YES
19 events_statements_current YES
20 events_statements_history YES
21 events_statements_history_long YES
22 events_transactions_current YES
23 events_transactions_history YES
24 events_transactions_history_long YES
25 events_waits_current YES
26 events_waits_history YES
27 events_waits_history_long YES
28 global_instrumentation YES
29 thread_instrumentation YES
30 statements_digest NO
31 TRUNCATE TABLE performance_schema.events_statements_summary_by_digest;
32 ####################################
33 # EXECUTION
34 ####################################
35 SELECT 1 FROM t1;
36 1
37 SELECT 1 FROM `t1`;
38 1
39 SELECT 1,2 FROM t1;
40 1 2
41 SELECT 1, 2, 3, 4 FROM t1;
42 1 2 3 4
43 SELECT 1 FROM t2;
44 1
45 SELECT 1,2 FROM t2;
46 1 2
47 SELECT 1, 2, 3, 4 FROM t2;
48 1 2 3 4
49 INSERT INTO t1 VALUES (1);
50 INSERT INTO t2 VALUES (1);
51 INSERT INTO t3 VALUES (1, 2);
52 INSERT INTO t4 VALUES (1, 2);
53 INSERT INTO t5 VALUES (1, 2, 3);
54 INSERT INTO t1 VALUES (1), (2), (3);
55 INSERT INTO t1 VALUES (1), (2), (3), (4);
56 INSERT INTO t3 VALUES (1, 2), (3, 4), (5, 6);
57 INSERT INTO t5 VALUES (1, 2, 3), (4, 5, 6), (7, 8, 9);
58 INSERT INTO t1 VALUES (NULL);
59 INSERT INTO t3 VALUES (NULL,NULL);
60 INSERT INTO t3 VALUES (1,NULL);
61 INSERT INTO t3 VALUES (NULL,1);
62 INSERT INTO t6 VALUES (NULL, NULL, NULL, NULL);
63 INSERT INTO t6 VALUES (1, NULL, NULL, NULL);
64 INSERT INTO t6 VALUES (NULL, 2, NULL, NULL);
65 INSERT INTO t6 VALUES (1, 2, 3, NULL);
66 INSERT INTO t6 VALUES (1, 2, NULL, 4);
67 SELECT 1 + 1;
68 1 + 1
69 2
70 SELECT 1;
71 1
72 1
73 SELECT 1 /* This is an inline comment */ + 1;
74 1 /* This is an inline comment */ + 1
75 2
76 SELECT 1+
77 /*
78 this is a
79 multiple-line comment
80 */
81 1;
82 1+
83 /*
84 this is a
85 multiple-line comment
86 */
87 1
88 2
89 CREATE SCHEMA statements_digest_temp;
90 DROP SCHEMA statements_digest_temp;
91 CREATE DATABASE statements_digest_temp;
92 DROP DATABASE statements_digest_temp;
93 SELECT 1 FROM no_such_table;
94 ERROR 42S02: Table 'statements_digest.no_such_table' doesn't exist
95 CREATE TABLE dup_table (c char(4));
96 CREATE TABLE dup_table (c char(4));
97 ERROR 42S01: Table 'dup_table' already exists
98 DROP TABLE dup_table;
99 INSERT IGNORE INTO t11 VALUES("MySQL");
100 Warnings:
101 Warning 1265 Data truncated for column 'c' at row 1
102 PREPARE stmt FROM "SELECT * FROM t12";
103 EXECUTE stmt;
104 c
105 EXECUTE stmt;
106 c
107 DEALLOCATE PREPARE stmt;
108 CREATE PROCEDURE p1() BEGIN SELECT * FROM t12; END//
109 CALL p1();
110 c
111 CALL p1();
112 c
113 DROP PROCEDURE p1;
114 CREATE FUNCTION `func`(a INT, b INT) RETURNS int(11) RETURN a+b //
115 select func(3,4);
116 func(3,4)
117 7
118 select func(13,42);
119 func(13,42)
120 55
121 DROP FUNCTION func;
122 CREATE TRIGGER trg BEFORE INSERT ON t12 FOR EACH ROW SET @a:=1;
123 INSERT INTO t12 VALUES ("abc");
124 INSERT INTO t12 VALUES ("def");
125 DROP TRIGGER trg;
126 ####################################
127 # QUERYING PS STATEMENT DIGEST
128 ####################################
129 SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
130 schema_name digest digest_text count_star
131 SELECT digest, digest_text FROM performance_schema.events_statements_current
132 INNER JOIN performance_schema.threads
133 ON events_statements_current.thread_id=threads.thread_id
134 WHERE threads.processlist_id=connection_id();
135 digest digest_text
136 NULL NULL
137 ####################################
138 # CLEANUP
139 ####################################
140 DROP TABLE IF EXISTS t1;
141 DROP TABLE IF EXISTS t2;
142 DROP TABLE IF EXISTS t3;
143 DROP TABLE IF EXISTS t4;
144 DROP TABLE IF EXISTS t5;
145 DROP TABLE IF EXISTS t6;
146 DROP TABLE IF EXISTS t11;
147 DROP TABLE IF EXISTS t12;
148 DROP DATABASE IF EXISTS statements_digest;