Debian Codegraph @

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

raw
1 TABLE: "socket_instances"
2 INDEXES: PK (OBJECT_INSTANCE_BEGIN), KEY (THREAD_ID), KEY (SOCKET_ID), KEY (IP), KEY (PORT)
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 ## Test OBJECT_INSTANCE_BEGIN
53
54 ===== BEGIN TEST =====
55 ========
56 SELECT * FROM performance_schema.socket_instances WHERE object_instance_begin is null
57
58 OK: Handler_read_key
59
60 OK: Result set: Empty Expected: Empty
61
62 OK: Extra rows: 0 Missing rows: 0
63 ========
64 SELECT * FROM performance_schema.socket_instances WHERE object_instance_begin is not null
65
66 OK: Handler_read_key
67
68 OK: Result set: Non-empty Expected: Non-empty
69
70 OK: Extra rows: 0 Missing rows: 0
71 ========
72 SELECT * FROM performance_schema.socket_instances WHERE object_instance_begin = @object_instance_begin
73
74 OK: Handler_read_key
75
76 OK: Result set: Non-empty Expected: Non-empty
77
78 OK: Extra rows: 0 Missing rows: 0
79 ========
80 SELECT * FROM performance_schema.socket_instances WHERE object_instance_begin != @object_instance_begin
81
82 OK: Handler_read_key
83
84 OK: Result set: Non-empty Expected: Non-empty
85
86 OK: Extra rows: 0 Missing rows: 0
87 ========
88 SELECT * FROM performance_schema.socket_instances WHERE object_instance_begin = '9999999999'
89
90 OK: Handler_read_key
91
92 OK: Result set: Empty Expected: Empty
93
94 OK: Extra rows: 0 Missing rows: 0
95
96 ## Test SOCKET_ID
97
98 ===== BEGIN TEST =====
99 ========
100 SELECT * FROM performance_schema.socket_instances WHERE SOCKET_ID is null
101
102 OK: Handler_read_key
103
104 OK: Result set: Empty Expected: Empty
105
106 OK: Extra rows: 0 Missing rows: 0
107 ========
108 SELECT * FROM performance_schema.socket_instances WHERE SOCKET_ID is not null
109
110 OK: Handler_read_key
111
112 OK: Result set: Non-empty Expected: Non-empty
113
114 OK: Extra rows: 0 Missing rows: 0
115 ========
116 SELECT * FROM performance_schema.socket_instances WHERE SOCKET_ID = @target_id
117
118 OK: Handler_read_key
119
120 OK: Result set: Non-empty Expected: Non-empty
121
122 OK: Extra rows: 0 Missing rows: 0
123 ========
124 SELECT * FROM performance_schema.socket_instances WHERE SOCKET_ID = @target_id ORDER BY SOCKET_ID
125
126 OK: Handler_read_key
127
128 OK: Result set: Non-empty Expected: Non-empty
129
130 OK: Extra rows: 0 Missing rows: 0
131 ========
132 SELECT * FROM performance_schema.socket_instances WHERE SOCKET_ID = @target_id ORDER BY SOCKET_ID DESC
133
134 OK: Handler_read_key
135
136 OK: Result set: Non-empty Expected: Non-empty
137
138 OK: Extra rows: 0 Missing rows: 0
139 ========
140 SELECT * FROM performance_schema.socket_instances WHERE SOCKET_ID = 9999999 ORDER BY SOCKET_ID
141
142 OK: Handler_read_key
143
144 OK: Result set: Empty Expected: Empty
145
146 OK: Extra rows: 0 Missing rows: 0
147
148 ## Test IP, PORT
149
150 ===== BEGIN TEST =====
151 ========
152 SELECT * FROM performance_schema.socket_instances WHERE IP is null
153
154 OK: Handler_read_key
155
156 OK: Result set: Empty Expected: Empty
157
158 OK: Extra rows: 0 Missing rows: 0
159 ========
160 SELECT * FROM performance_schema.socket_instances WHERE IP is not null
161
162 OK: Handler_read_key
163
164 OK: Result set: Non-empty Expected: Non-empty
165
166 OK: Extra rows: 0 Missing rows: 0
167 ========
168 SELECT * FROM performance_schema.socket_instances WHERE IP = '::' and port is null
169
170 OK: Handler_read_key
171
172 OK: Result set: Empty Expected: Empty
173
174 OK: Extra rows: 0 Missing rows: 0
175 ========
176 SELECT * FROM performance_schema.socket_instances WHERE IP = '::' and port is not null
177
178 OK: Handler_read_key
179
180 OK: Result set: Non-empty Expected: Non-empty
181
182 OK: Extra rows: 0 Missing rows: 0
183 ========
184 SELECT * FROM performance_schema.socket_instances WHERE IP = '::'
185
186 OK: Handler_read_key
187
188 OK: Result set: Non-empty Expected: Non-empty
189
190 OK: Extra rows: 0 Missing rows: 0
191 ========
192 SELECT * FROM performance_schema.socket_instances WHERE IP = 'impossible'
193
194 OK: Handler_read_key
195
196 OK: Result set: Empty Expected: Empty
197
198 OK: Extra rows: 0 Missing rows: 0
199 ========
200 SELECT * FROM performance_schema.socket_instances WHERE IP = '::' AND port = @target_port
201
202 OK: Handler_read_key
203
204 OK: Result set: Non-empty Expected: Non-empty
205
206 OK: Extra rows: 0 Missing rows: 0
207 ========
208 SELECT * FROM performance_schema.socket_instances WHERE IP = '::' AND port = 9999999
209
210 OK: Handler_read_key
211
212 OK: Result set: Empty Expected: Empty
213
214 OK: Extra rows: 0 Missing rows: 0
215 ========
216 SELECT * FROM performance_schema.socket_instances WHERE IP = 'impossible' AND port = @target_port
217
218 OK: Handler_read_key
219
220 OK: Result set: Empty Expected: Empty
221
222 OK: Extra rows: 0 Missing rows: 0
223 ========
224 SELECT * FROM performance_schema.socket_instances WHERE port = @target_port
225
226 OK: Handler_read_key
227
228 OK: Result set: Non-empty Expected: Non-empty
229
230 OK: Extra rows: 0 Missing rows: 0
231
232 ===== CLEAN UP =====
233 ## Default connection
234 DEALLOCATE PREPARE st1;
235 DEALLOCATE PREPARE st2;
236 DEALLOCATE PREPARE st3;
237 DEALLOCATE PREPARE st4;
238 DROP PROCEDURE SampleProc1;
239 DROP PROCEDURE index_test;
240 DROP TABLE IF EXISTS test.indexes_off;
241 DROP TABLE IF EXISTS test.indexes_on;
242 DROP TABLE test.t1;
243 DROP TABLE test.t2;
244 DROP TABLE test.t3;
245 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
246 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
247 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
248 DROP USER user1@localhost;
249 DROP USER user2@localhost;
250 DROP USER user3@localhost;
251 UPDATE performance_schema.threads SET INSTRUMENTED = 'YES';