Debian Codegraph @

mysql-test/suite/perfschema/include/idx_compare_load.inc

raw
1 --echo
2 --echo ===== BEGIN TEST =====
3
4 --disable_query_log
5
6 # THREAD_ID, EVENT_ID
7
8 IF ($key_group == 1)
9 {
10 eval CALL index_test($table, "WHERE thread_id is null");
11 eval CALL index_test($table, "WHERE thread_id is not null");
12 eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
13 eval CALL index_test($table, "WHERE event_id != 9999999");
14 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id");
15 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
16 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id is null");
17 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id is not null");
18 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id != 99999999");
19 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id = 99999999");
20 eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
21 eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
22 eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
23 eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
24 }
25
26 # OWNER_THREAD_ID, OWNER_EVENT_ID
27
28 IF ($key_group == 1.1)
29 {
30 eval CALL index_test($table, "WHERE owner_thread_id is null");
31 eval CALL index_test($table, "WHERE owner_thread_id is not null");
32 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id");
33 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id = @target_event_id");
34 eval CALL index_test($table, "WHERE owner_event_id != 9999999");
35 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id ORDER BY owner_thread_id");
36 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id ORDER BY owner_thread_id DESC");
37 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id is null");
38 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id is not null");
39 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id != 99999999");
40 eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id = 99999999");
41 eval CALL index_test($table, "WHERE owner_thread_id >= @target_thread_id");
42 eval CALL index_test($table, "WHERE owner_thread_id <= @target_thread_id");
43 eval CALL index_test($table, "WHERE owner_thread_id != 9999999 AND owner_event_id = @target_event_id");
44 eval CALL index_test($table, "WHERE owner_thread_id = 9999999 ORDER BY owner_thread_id");
45 }
46
47 # THREAD_ID, ERROR_NUMBER
48
49 IF ($key_group == 1.2)
50 {
51 eval CALL index_test($table, "WHERE thread_id is null");
52 eval CALL index_test($table, "WHERE thread_id is not null");
53 eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
54 eval CALL index_test($table, "WHERE error_number != 9999999");
55 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id");
56 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
57 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND error_number is null");
58 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND error_number is not null");
59 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND error_number = 99999999");
60 eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
61 eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
62 eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
63 eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
64 }
65
66 # USER, HOST, EVENT_NAME
67
68 IF ($key_group == 2)
69 {
70 eval CALL index_test($table, "WHERE user is null");
71 eval CALL index_test($table, "WHERE user is not null");
72 eval CALL index_test($table, "WHERE user = 'user1' and host is null");
73 eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
74 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and event_name is null");
75 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and event_name is not null");
76 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
77 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND event_name = '$target_event_name'");
78 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND event_name = 'impossible'");
79 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser' AND event_name = '$target_event_name'");
80 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser' AND event_name = '$target_event_name'");
81 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1' AND event_name = '$target_event_name'");
82 }
83
84 # USER, HOST
85
86 IF ($key_group == 2.1)
87 {
88 eval CALL index_test($table, "WHERE user is null");
89 eval CALL index_test($table, "WHERE user is not null");
90 eval CALL index_test($table, "WHERE user = 'user1' and host is null");
91 eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
92 eval CALL index_test($table, "WHERE host = '$target_host'");
93 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
94 #eval CALL index_test($table, "WHERE host != '$target_host' AND user != 'user1'");
95 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser'");
96 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser'");
97 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1'");
98 }
99
100 # PROCESSLIST_USER, PROCESSLIST_HOST
101
102 IF ($key_group == 2.1.1)
103 {
104 eval CALL index_test($table, "WHERE processlist_user is null");
105 eval CALL index_test($table, "WHERE processlist_user is not null");
106 eval CALL index_test($table, "WHERE processlist_user = 'user1' and processlist_host is null");
107 eval CALL index_test($table, "WHERE processlist_user = 'user1' and processlist_host is not null");
108 eval CALL index_test($table, "WHERE processlist_host = '$target_host'");
109 eval CALL index_test($table, "WHERE processlist_host = '$target_host' AND processlist_user= '$target_user'");
110 eval CALL index_test($table, "WHERE processlist_host != '$target_host' AND processlist_user != '$target_user'");
111 eval CALL index_test($table, "WHERE processlist_host = 'nohost' AND processlist_user= 'nouser'");
112 eval CALL index_test($table, "WHERE processlist_host = '$target_host' AND processlist_user= 'nouser'");
113 eval CALL index_test($table, "WHERE processlist_host = 'nohost' AND processlist_user= '$target_user'");
114 }
115
116 # USER, HOST, VARIABLE_NAME
117
118 IF ($key_group == 2.2)
119 {
120 eval CALL index_test($table, "WHERE user is null");
121 eval CALL index_test($table, "WHERE user is not null");
122 eval CALL index_test($table, "WHERE user = 'user1' and host is null");
123 eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
124 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and variable_name is null");
125 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and variable_name is not null");
126 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
127 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND variable_name = '$target_variable_name'");
128 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND variable_name = 'impossible'");
129 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser' AND variable_name = '$target_variable_name'");
130 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser' AND variable_name = '$target_variable_name'");
131 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1' AND variable_name = '$target_variable_name'");
132 }
133
134 # USER, HOST, ERROR_NUMBER
135
136 IF ($key_group == 2.3)
137 {
138 eval CALL index_test($table, "WHERE user is null");
139 eval CALL index_test($table, "WHERE user is not null");
140 eval CALL index_test($table, "WHERE user = 'user1' and host is null");
141 eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
142 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and error_number is null");
143 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and error_number is not null");
144 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
145 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND error_number = '$target_error_number'");
146 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND error_number = 999999");
147 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser' AND error_number = '$target_error_number'");
148 eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser' AND error_number = '$target_error_number'");
149 eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1' AND error_number = '$target_error_number'");
150 }
151
152 # HOST, ERROR_NUMBER
153
154 IF ($key_group == 2.4)
155 {
156 eval CALL index_test($table, "WHERE host is null");
157 eval CALL index_test($table, "WHERE host is not null");
158 eval CALL index_test($table, "WHERE host = '$target_host' and error_number is null");
159 eval CALL index_test($table, "WHERE host = '$target_host' and error_number is not null");
160 eval CALL index_test($table, "WHERE host = '$target_host'");
161 eval CALL index_test($table, "WHERE host = '$target_host' AND error_number = '$target_error_number'");
162 eval CALL index_test($table, "WHERE host = '$target_host' AND error_number = 999999");
163 eval CALL index_test($table, "WHERE host = 'nohost' AND error_number = '$target_error_number'");
164 }
165
166 # USER, ERROR_NUMBER
167
168 IF ($key_group == 2.5)
169 {
170 eval CALL index_test($table, "WHERE user is null");
171 eval CALL index_test($table, "WHERE user is not null");
172 eval CALL index_test($table, "WHERE user = 'user1' and error_number is null");
173 eval CALL index_test($table, "WHERE user = 'user1' and error_number is not null");
174 eval CALL index_test($table, "WHERE user= 'user1'");
175 eval CALL index_test($table, "WHERE user= 'user1' AND error_number = '$target_error_number'");
176 eval CALL index_test($table, "WHERE user= 'user1' AND error_number = 999999");
177 eval CALL index_test($table, "WHERE user= 'nouser' AND error_number = '$target_error_number'");
178 }
179
180 # ERROR_NUMBER
181
182 IF ($key_group == 2.6)
183 {
184 eval CALL index_test($table, "WHERE error_number is null");
185 eval CALL index_test($table, "WHERE error_number is not null");
186 eval CALL index_test($table, "WHERE error_number = '$target_error_number'");
187 eval CALL index_test($table, "WHERE error_number = '$target_error_number' ORDER BY error_number");
188 eval CALL index_test($table, "WHERE error_number = '$target_error_number' ORDER BY error_number DESC");
189 eval CALL index_test($table, "WHERE error_number > '$target_error_number'");
190 eval CALL index_test($table, "WHERE error_number < '$target_error_number'");
191 eval CALL index_test($table, "WHERE error_number >= '$target_error_number'");
192 eval CALL index_test($table, "WHERE error_number <= '$target_error_number'");
193 }
194
195 # USER, HOST, ROLE
196
197 IF ($key_group == 2.7)
198 {
199 eval CALL index_test($table, "WHERE user is null");
200 eval CALL index_test($table, "WHERE user is not null");
201 eval CALL index_test($table, "WHERE user = 'user1' and host is null");
202 eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
203 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and `role` is null");
204 eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and `role` is not null");
205 eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'user1'");
206 eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'user1' AND `role` = '%'");
207 eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'user1' AND `role` = 'impossible'");
208 eval CALL index_test($table, "WHERE host = 'nohost' AND user = 'nouser' AND `role` = '%'");
209 eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'nouser' AND `role` = '%'");
210 eval CALL index_test($table, "WHERE host = 'nohost' AND user = 'user1' AND `role` = '%'");
211 }
212
213 # USER, EVENT_NAME
214
215 IF ($key_group == 3)
216 {
217 eval CALL index_test($table, "WHERE user is null");
218 eval CALL index_test($table, "WHERE user is not null");
219 eval CALL index_test($table, "WHERE user = 'user1' and event_name is null");
220 eval CALL index_test($table, "WHERE user = 'user1' and event_name is not null");
221 eval CALL index_test($table, "WHERE user= 'user1'");
222 eval CALL index_test($table, "WHERE user= 'user1' AND event_name = '$target_event_name'");
223 eval CALL index_test($table, "WHERE user= 'user1' AND event_name = 'impossible'");
224 eval CALL index_test($table, "WHERE user= 'nouser' AND event_name = '$target_event_name'");
225 }
226
227 # USER, VARIABLE_NAME
228
229 IF ($key_group == 3.1)
230 {
231 eval CALL index_test($table, "WHERE user is null");
232 eval CALL index_test($table, "WHERE user is not null");
233 eval CALL index_test($table, "WHERE user = 'user1' and variable_name is null");
234 eval CALL index_test($table, "WHERE user = 'user1' and variable_name is not null");
235 eval CALL index_test($table, "WHERE user= 'user1'");
236 eval CALL index_test($table, "WHERE user= 'user1' AND variable_name = '$target_variable_name'");
237 eval CALL index_test($table, "WHERE user= 'user1' AND variable_name = 'impossible'");
238 eval CALL index_test($table, "WHERE user= 'nouser' AND variable_name = '$target_variable_name'");
239 }
240
241 # THREAD_ID, EVENT_NAME
242
243 IF ($key_group == 4)
244 {
245 eval CALL index_test($table, "WHERE thread_id is null");
246 eval CALL index_test($table, "WHERE thread_id is not null");
247 eval CALL index_test($table, "WHERE thread_id = @target_thread_id and event_name is null");
248 eval CALL index_test($table, "WHERE thread_id = @target_thread_id and event_name is not null");
249 eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
250 eval CALL index_test($table, "WHERE event_name != '$target_event_name'");
251 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
252 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = '$target_event_name'");
253 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name != '$target_event_name'");
254 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = 'impossible'");
255 eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
256 eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
257 eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
258 eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
259 }
260
261 # FIXME
262
263 IF ($key_group == 4.1)
264 {
265 eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
266 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
267 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = '$target_event_name'");
268 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = 'impossible'");
269 eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
270 eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
271 eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
272 eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
273 }
274
275 # EVENT_NAME
276
277 IF ($key_group == 5)
278 {
279 eval CALL index_test($table, "WHERE event_name is null");
280 eval CALL index_test($table, "WHERE event_name is not null");
281 eval CALL index_test($table, "WHERE event_name = '$target_event_name'");
282 eval CALL index_test($table, "WHERE event_name != '$target_event_name'");
283 eval CALL index_test($table, "WHERE event_name = 'impossible'");
284 eval CALL index_test($table, "WHERE event_name != 'impossible' ORDER BY event_name DESC");
285 }
286
287 # FIXME
288 # EVENT_NAME (for events with only 1 class)
289
290 IF ($key_group == 5.1)
291 {
292 eval CALL index_test($table, "WHERE event_name = '$target_event_name'");
293 eval CALL index_test($table, "WHERE event_name = 'impossible'");
294 eval CALL index_test($table, "WHERE event_name != 'impossible' ORDER BY event_name DESC");
295 }
296
297 # HOST, EVENT_NAME
298
299 IF ($key_group == 6)
300 {
301 eval CALL index_test($table, "WHERE host is null");
302 eval CALL index_test($table, "WHERE host is not null");
303 eval CALL index_test($table, "WHERE host = '$target_host' and event_name is null");
304 eval CALL index_test($table, "WHERE host = '$target_host' and event_name is not null");
305 eval CALL index_test($table, "WHERE host = '$target_host'");
306 eval CALL index_test($table, "WHERE host = '$target_host' AND event_name = '$target_event_name'");
307 eval CALL index_test($table, "WHERE host = '$target_host' AND event_name = 'impossible'");
308 eval CALL index_test($table, "WHERE host = 'nohost' AND event_name = '$target_event_name'");
309 }
310
311 # HOST, VARIABLE_NAME
312
313 IF ($key_group == 6.1)
314 {
315 eval CALL index_test($table, "WHERE host is null");
316 eval CALL index_test($table, "WHERE host is not null");
317 eval CALL index_test($table, "WHERE host = '$target_host' and variable_name is null");
318 eval CALL index_test($table, "WHERE host = '$target_host' and variable_name is not null");
319 eval CALL index_test($table, "WHERE host = '$target_host'");
320 eval CALL index_test($table, "WHERE host = '$target_host' AND variable_name = '$target_variable_name'");
321 eval CALL index_test($table, "WHERE host = '$target_host' AND variable_name = 'impossible'");
322 eval CALL index_test($table, "WHERE host = 'nohost' AND variable_name = '$target_variable_name'");
323 }
324
325 # HOST
326
327 IF ($key_group == 6.2)
328 {
329 eval CALL index_test($table, "WHERE host = '$target_host'");
330 eval CALL index_test($table, "WHERE host IS NULL");
331 eval CALL index_test($table, "WHERE host IS NOT NULL");
332 eval CALL index_test($table, "WHERE host = 'nohost'");
333 }
334
335 # PROCESSLIST_HOST
336
337 IF ($key_group == 6.3)
338 {
339 eval CALL index_test($table, "WHERE processlist_host = '$target_host'");
340 eval CALL index_test($table, "WHERE processlist_host IS NULL");
341 eval CALL index_test($table, "WHERE processlist_host IS NOT NULL");
342 eval CALL index_test($table, "WHERE processlist_host = 'nohost'");
343 }
344
345 # THREAD_ID, VARIABLE_NAME
346
347 IF ($key_group == 7)
348 {
349 eval CALL index_test($table, "WHERE thread_id is null");
350 eval CALL index_test($table, "WHERE thread_id is not null");
351 eval CALL index_test($table, "WHERE thread_id = @target_thread_id and variable_name is null");
352 eval CALL index_test($table, "WHERE thread_id = @target_thread_id and variable_name is not null");
353 eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
354 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
355 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND variable_name = '$target_variable_name'");
356 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND variable_name != '$target_variable_name'");
357 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND variable_name = 'impossible'");
358 eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
359 eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
360 eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
361 eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
362 }
363
364 # VARIABLE_NAME
365
366 IF ($key_group == 8)
367 {
368 eval CALL index_test($table, "WHERE variable_name is null");
369 eval CALL index_test($table, "WHERE variable_name is not null");
370 eval CALL index_test($table, "WHERE variable_name = '$target_variable_name'");
371 eval CALL index_test($table, "WHERE variable_name != '$target_variable_name'");
372 eval CALL index_test($table, "WHERE variable_name = 'impossible'");
373 eval CALL index_test($table, "WHERE variable_name != 'impossible' ORDER BY variable_name DESC");
374 }
375
376 # THREAD_ID, NAME
377
378 IF ($key_group == 9)
379 {
380 eval CALL index_test($table, "WHERE thread_id is null");
381 eval CALL index_test($table, "WHERE thread_id is not null");
382 eval CALL index_test($table, "WHERE thread_id = @target_thread_id and name is null");
383 eval CALL index_test($table, "WHERE thread_id = @target_thread_id and name is not null");
384 eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
385 eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
386 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND name = '$target_name'");
387 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND name != '$target_name'");
388 eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND name = 'impossible'");
389 eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
390 eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
391 eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
392 eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
393 }
394
395 # PROCESSLIST_ID, ATTR_NAME -- Multiple connections
396
397 IF ($key_group == 9.1)
398 {
399 eval CALL index_test($table, "WHERE processlist_id is null");
400 eval CALL index_test($table, "WHERE processlist_id is not null");
401 eval CALL index_test($table, "WHERE processlist_id = @target_id and attr_name is null");
402 eval CALL index_test($table, "WHERE processlist_id = @target_id and attr_name is not null");
403 eval CALL index_test($table, "WHERE processlist_id = @target_id");
404 eval CALL index_test($table, "WHERE processlist_id = @target_id ORDER BY processlist_id DESC");
405 eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = '$target_name'");
406 eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name != '$target_name'");
407 eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = 'impossible'");
408 eval CALL index_test($table, "WHERE processlist_id > @target_id");
409 eval CALL index_test($table, "WHERE processlist_id < @target_id");
410 eval CALL index_test($table, "WHERE processlist_id >= @target_id");
411 eval CALL index_test($table, "WHERE processlist_id <= @target_id");
412 }
413
414 # FIXME
415 # PROCESSLIST_ID, ATTR_NAME -- Current connection
416
417 IF ($key_group == 9.2)
418 {
419 eval CALL index_test($table, "WHERE processlist_id = @target_id");
420 eval CALL index_test($table, "WHERE attr_name != '$target_name'");
421 eval CALL index_test($table, "WHERE processlist_id = @target_id ORDER BY processlist_id DESC");
422 eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = '$target_name'");
423 eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name != '$target_name'");
424 eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = 'impossible'");
425 eval CALL index_test($table, "WHERE processlist_id > @target_id");
426 eval CALL index_test($table, "WHERE processlist_id < @target_id");
427 eval CALL index_test($table, "WHERE processlist_id >= @target_id");
428 eval CALL index_test($table, "WHERE processlist_id <= @target_id");
429 eval CALL index_test($table, "WHERE processlist_id > 9999999");
430 eval CALL index_test($table, "WHERE processlist_id < 9999999");
431 eval CALL index_test($table, "WHERE processlist_id >= 9999999");
432 eval CALL index_test($table, "WHERE processlist_id <= 9999999");
433 }
434
435 # OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME
436
437 IF ($key_group == 10)
438 {
439 eval CALL index_test($table, "WHERE object_type is null");
440 eval CALL index_test($table, "WHERE object_type is not null");
441 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is null");
442 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is not null");
443 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is null");
444 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is not null");
445 eval CALL index_test($table, "WHERE object_type = '$target_type'");
446 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema'");
447 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name'");
448 eval CALL index_test($table, "WHERE object_type = 'impossible' AND object_schema = '$target_schema' AND object_name = '$target_name'");
449 eval CALL index_test($table, "WHERE object_type = 'impossible'");
450 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = 'impossible'");
451 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = 'impossible'");
452 }
453
454 # OWNER_OBJECT_TYPE, OWNER_OBJECT_SCHEMA, OWNER_OBJECT_NAME
455
456 IF ($key_group == 10.1)
457 {
458 eval CALL index_test($table, "WHERE owner_object_type is null");
459 eval CALL index_test($table, "WHERE owner_object_type is not null");
460 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema is null");
461 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema is not null");
462 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema = '$target_schema' and owner_object_name is null");
463 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema = '$target_schema' and owner_object_name is not null");
464 eval CALL index_test($table, "WHERE owner_object_type = '$target_type'");
465 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = '$target_schema'");
466 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = '$target_schema' AND owner_object_name = '$target_name'");
467 eval CALL index_test($table, "WHERE owner_object_type = 'impossible' AND owner_object_schema = '$target_schema' AND owner_object_name = '$target_name'");
468 eval CALL index_test($table, "WHERE owner_object_type = 'impossible'");
469 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = 'impossible'");
470 eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = '$target_schema' AND owner_object_name = 'impossible'");
471 }
472
473 # OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME
474
475 IF ($key_group == 11)
476 {
477 eval CALL index_test($table, "WHERE object_type is null");
478 eval CALL index_test($table, "WHERE object_type is not null");
479 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is null");
480 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is not null");
481 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is null");
482 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is not null");
483 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name = '$target_name' and index_name is null");
484 eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name = '$target_name' and index_name is not null");
485 eval CALL index_test($table, "WHERE object_type = '$target_type'");
486 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema'");
487 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name'");
488 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name' AND index_name = '$target_index'");
489 eval CALL index_test($table, "WHERE object_type = 'impossible' AND object_schema = '$target_schema' AND object_name = '$target_name'");
490 eval CALL index_test($table, "WHERE object_type = 'impossible'");
491 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = 'impossible'");
492 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = 'impossible'");
493 eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name' AND index_name = 'impossible'");
494 }
495
496 # OBJECT_INSTANCE_BEGIN
497
498 IF ($key_group == 12)
499 {
500 eval CALL index_test($table, "WHERE object_instance_begin is null");
501 eval CALL index_test($table, "WHERE object_instance_begin is not null");
502 eval CALL index_test($table, "WHERE object_instance_begin = @object_instance_begin");
503
504 # NOTE: The following test is disabled for metadata locks because it will give
505 # a different number of locks for indexed and non-indexed access. The
506 # non-indexed access will try to use histogram statistics, and will thus use
507 # one more metadata lock.
508 IF ($table != "metadata_locks")
509 {
510 eval CALL index_test($table, "WHERE object_instance_begin != @object_instance_begin");
511 }
512
513 eval CALL index_test($table, "WHERE object_instance_begin = '9999999999'");
514 }
515
516 # GENERIC NAME - EVENT_NAME / NAME / STATEMENT_NAME
517
518 IF ($key_group == 13)
519 {
520 eval CALL index_test($table, "WHERE $name_column is null");
521 eval CALL index_test($table, "WHERE $name_column is not null");
522 eval CALL index_test($table, "WHERE $name_column = '$target_name'");
523 eval CALL index_test($table, "WHERE $name_column != '$target_name'");
524 eval CALL index_test($table, "WHERE $name_column = 'impossible'");
525 eval CALL index_test($table, "WHERE $name_column != 'impossible' ORDER BY $name_column DESC");
526 }
527
528 # FIXME
529 # FILE_NAME
530
531 IF ($key_group == 13.1)
532 {
533 eval CALL index_test($table, "WHERE $name_column = @target_name");
534 eval CALL index_test($table, "WHERE $name_column != @target_name");
535 eval CALL index_test($table, "WHERE $name_column = 'impossible'");
536 eval CALL index_test($table, "WHERE $name_column != 'impossible' ORDER BY $name_column DESC");
537 }
538
539 # GENERIC ID - THREAD_ID / LOCKED_BY_THREAD_ID / STATEMENT_ID / SOCKET_ID
540
541 IF ($key_group == 14)
542 {
543 eval CALL index_test($table, "WHERE $id_column is null");
544 eval CALL index_test($table, "WHERE $id_column is not null");
545 eval CALL index_test($table, "WHERE $id_column = @target_id");
546 eval CALL index_test($table, "WHERE $id_column = @target_id ORDER BY $id_column");
547 eval CALL index_test($table, "WHERE $id_column = @target_id ORDER BY $id_column DESC");
548 eval CALL index_test($table, "WHERE $id_column = 9999999 ORDER BY $id_column");
549 }
550
551 # IP
552
553 IF ($key_group == 15)
554 {
555 eval CALL index_test($table, "WHERE IP is null");
556 eval CALL index_test($table, "WHERE IP is not null");
557 eval CALL index_test($table, "WHERE IP = '$target_ip'");
558 #eval CALL index_test($table, "WHERE IP != '$target_ip'");
559 eval CALL index_test($table, "WHERE IP = 'impossible'");
560 }
561
562 # PORT
563
564 IF ($key_group == 16)
565 {
566 eval CALL index_test($table, "WHERE port is null");
567 eval CALL index_test($table, "WHERE port is not null");
568 eval CALL index_test($table, "WHERE port = @target_port");
569 eval CALL index_test($table, "WHERE port = @target_port ORDER BY port");
570 eval CALL index_test($table, "WHERE port = 9999999");
571 eval CALL index_test($table, "WHERE port > 9999999");
572 eval CALL index_test($table, "WHERE port < 9999999");
573 eval CALL index_test($table, "WHERE port >= 9999999");
574 eval CALL index_test($table, "WHERE port <= 9999999");
575 }
576
577 # IP, PORT
578
579 IF ($key_group == 16.1)
580 {
581 eval CALL index_test($table, "WHERE IP is null");
582 eval CALL index_test($table, "WHERE IP is not null");
583 eval CALL index_test($table, "WHERE IP = '$target_ip' and port is null");
584 eval CALL index_test($table, "WHERE IP = '$target_ip' and port is not null");
585 eval CALL index_test($table, "WHERE IP = '$target_ip'");
586 eval CALL index_test($table, "WHERE IP = 'impossible'");
587 eval CALL index_test($table, "WHERE IP = '$target_ip' AND port = @target_port");
588 eval CALL index_test($table, "WHERE IP = '$target_ip' AND port = 9999999");
589 eval CALL index_test($table, "WHERE IP = 'impossible' AND port = @target_port");
590 eval CALL index_test($table, "WHERE port = @target_port");
591 }
592
593 # SCHEMA_NAME, DIGEST
594
595 IF ($key_group == 17)
596 {
597 eval CALL index_test($table, "WHERE schema_name is null");
598 eval CALL index_test($table, "WHERE schema_name is not null");
599 eval CALL index_test($table, "WHERE schema_name = '$target_schema' and digest is null");
600 eval CALL index_test($table, "WHERE schema_name = '$target_schema' and digest is not null");
601 eval CALL index_test($table, "WHERE schema_name = '$target_schema'");
602 eval CALL index_test($table, "WHERE schema_name != '$target_schema'");
603 eval CALL index_test($table, "WHERE schema_name = '$target_schema' AND digest = @target_digest");
604 eval CALL index_test($table, "WHERE schema_name = '$target_schema' AND digest = 'impossible'");
605 eval CALL index_test($table, "WHERE schema_name = 'noschema_name' AND digest = @target_digest");
606 }
607
608 # CHANNEL_NAME
609
610 IF ($key_group == 18)
611 {
612 eval CALL index_test($table, "WHERE CHANNEL_NAME is null");
613 eval CALL index_test($table, "WHERE CHANNEL_NAME is not null");
614 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name");
615 eval CALL index_test($table, "WHERE CHANNEL_NAME != $target_channel_name");
616 eval CALL index_test($table, "WHERE CHANNEL_NAME = 'impossible'");
617 eval CALL index_test($table, "WHERE CHANNEL_NAME != 'impossible' ORDER BY CHANNEL_NAME DESC");
618 }
619
620 # CHANNEL_NAME, WORKER_ID
621
622 IF ($key_group == 18.1)
623 {
624 eval CALL index_test($table, "WHERE CHANNEL_NAME is null");
625 eval CALL index_test($table, "WHERE CHANNEL_NAME is not null");
626 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name");
627 eval CALL index_test($table, "WHERE CHANNEL_NAME != $target_channel_name");
628 eval CALL index_test($table, "WHERE CHANNEL_NAME = 'impossible'");
629 eval CALL index_test($table, "WHERE CHANNEL_NAME != 'impossible' ORDER BY CHANNEL_NAME DESC");
630 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID is null");
631 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID is not null");
632 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID = $target_worker_id");
633 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID != $target_worker_id");
634 eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID = 9999");
635 }
636
637 --enable_query_log