Debian Codegraph @

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

raw
1 TABLE: "memory_summary_by_thread_by_event_name"
2 INDEXES: PK (THREAD_ID, EVENT_NAME)
3
4 ===== SETUP =====
5 ## Connection Default
6 ## Disable events from the default connection
7
8 ## Create user1, user2, user3
9 CREATE USER user1@localhost;
10 CREATE USER user2@localhost;
11 CREATE USER user3@localhost;
12 GRANT ALL ON *.* to 'user1'@localhost;
13 GRANT ALL ON *.* to 'user2'@localhost;
14 GRANT ALL ON *.* to 'user3'@localhost;
15
16 ## Setup test connection 1
17 ## Setup test connection 2
18 ## Setup test connection 3
19
20 ## Default connection
21
22 ## Create data tables
23 CREATE TABLE test.t1(a INT, b INT, c INT, d INT DEFAULT 0, PRIMARY KEY(a), INDEX index_b(b), INDEX index_cb(c, b));
24 CREATE TABLE test.t2 LIKE test.t1;
25 CREATE TABLE test.t3 LIKE test.t1;
26
27 ## Generate event data from 3 connections
28 ## Connection 1
29 ## Connection 2
30 ## Connection 3
31 ## Connection 2
32 ## Create prepared statements on connection 2
33 PREPARE st1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
34 PREPARE st3 FROM 'INSERT INTO test.t1 SELECT * FROM test.t1 WHERE a<=?';
35 PREPARE st4 FROM '(SELECT a FROM test.t1) UNION (SELECT a+10 FROM test.t1) ORDER BY RAND()*0+a';
36 ## Create stored procedure connection 2
37 CREATE PROCEDURE SampleProc1()
38 BEGIN
39 SET @table = 'test.t1';
40 SET @s = CONCAT('SELECT * FROM ', @table);
41 PREPARE st2 FROM @s;
42 END|
43
44 Call SampleProc1() to prepare a statement
45 CALL SampleProc1();
46 ## Connection default
47
48 ## Use Connection 2 for default target thread id
49
50 ## Create index_test() procedure
51
52 ===== BEGIN TEST =====
53 ========
54 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id is null
55
56 OK: Handler_read_key
57
58 OK: Result set: Empty Expected: Empty
59
60 OK: Extra rows: 0 Missing rows: 0
61 ========
62 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id is not null
63
64 OK: Handler_read_key
65
66 OK: Result set: Non-empty Expected: Non-empty
67
68 OK: Extra rows: 0 Missing rows: 0
69 ========
70 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id and event_name is null
71
72 OK: Handler_read_key
73
74 OK: Result set: Empty Expected: Empty
75
76 OK: Extra rows: 0 Missing rows: 0
77 ========
78 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id and event_name is not null
79
80 OK: Handler_read_key
81
82 OK: Result set: Non-empty Expected: Non-empty
83
84 OK: Extra rows: 0 Missing rows: 0
85 ========
86 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id
87
88 OK: Handler_read_key
89
90 OK: Result set: Non-empty Expected: Non-empty
91
92 OK: Extra rows: 0 Missing rows: 0
93 ========
94 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE event_name != 'memory/sql/help'
95
96 OK: Handler_read_key
97
98 OK: Result set: Non-empty Expected: Non-empty
99
100 OK: Extra rows: 0 Missing rows: 0
101 ========
102 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id ORDER BY thread_id DESC
103
104 OK: Handler_read_key
105
106 OK: Result set: Non-empty Expected: Non-empty
107
108 OK: Extra rows: 0 Missing rows: 0
109 ========
110 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id AND event_name = 'memory/sql/help'
111
112 OK: Handler_read_key
113
114 OK: Result set: Non-empty Expected: Non-empty
115
116 OK: Extra rows: 0 Missing rows: 0
117 ========
118 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id AND event_name != 'memory/sql/help'
119
120 OK: Handler_read_key
121
122 OK: Result set: Non-empty Expected: Non-empty
123
124 OK: Extra rows: 0 Missing rows: 0
125 ========
126 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id = @target_thread_id AND event_name = 'impossible'
127
128 OK: Handler_read_key
129
130 OK: Result set: Empty Expected: Empty
131
132 OK: Extra rows: 0 Missing rows: 0
133 ========
134 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id > @target_thread_id
135
136 OK: Handler_read_key
137
138 OK: Result set: Non-empty Expected: Non-empty
139
140 OK: Extra rows: 0 Missing rows: 0
141 ========
142 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id < @target_thread_id
143
144 OK: Handler_read_key
145
146 OK: Result set: Non-empty Expected: Non-empty
147
148 OK: Extra rows: 0 Missing rows: 0
149 ========
150 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id >= @target_thread_id
151
152 OK: Handler_read_key
153
154 OK: Result set: Non-empty Expected: Non-empty
155
156 OK: Extra rows: 0 Missing rows: 0
157 ========
158 SELECT * FROM performance_schema.memory_summary_by_thread_by_event_name WHERE thread_id <= @target_thread_id
159
160 OK: Handler_read_key
161
162 OK: Result set: Non-empty Expected: Non-empty
163
164 OK: Extra rows: 0 Missing rows: 0
165
166 ===== CLEAN UP =====
167 ## Default connection
168 DEALLOCATE PREPARE st1;
169 DEALLOCATE PREPARE st2;
170 DEALLOCATE PREPARE st3;
171 DEALLOCATE PREPARE st4;
172 DROP PROCEDURE SampleProc1;
173 DROP PROCEDURE index_test;
174 DROP TABLE IF EXISTS test.indexes_off;
175 DROP TABLE IF EXISTS test.indexes_on;
176 DROP TABLE test.t1;
177 DROP TABLE test.t2;
178 DROP TABLE test.t3;
179 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
180 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
181 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
182 DROP USER user1@localhost;
183 DROP USER user2@localhost;
184 DROP USER user3@localhost;
185 UPDATE performance_schema.threads SET INSTRUMENTED = 'YES';