File: idx_compare_load.inc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (637 lines) | stat: -rw-r--r-- 34,721 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
--echo
--echo ===== BEGIN TEST =====

--disable_query_log

# THREAD_ID, EVENT_ID

IF ($key_group == 1)
{
  eval CALL index_test($table, "WHERE thread_id is null");
  eval CALL index_test($table, "WHERE thread_id is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE event_id != 9999999");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id is null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id != 99999999");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_id = 99999999");
  eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
}

# OWNER_THREAD_ID, OWNER_EVENT_ID

IF ($key_group == 1.1)
{
  eval CALL index_test($table, "WHERE owner_thread_id is null");
  eval CALL index_test($table, "WHERE owner_thread_id is not null");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id = @target_event_id");
  eval CALL index_test($table, "WHERE owner_event_id != 9999999");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id ORDER BY owner_thread_id");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id ORDER BY owner_thread_id DESC");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id is null");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id is not null");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id != 99999999");
  eval CALL index_test($table, "WHERE owner_thread_id = @target_thread_id AND owner_event_id = 99999999");
  eval CALL index_test($table, "WHERE owner_thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE owner_thread_id <= @target_thread_id");
  eval CALL index_test($table, "WHERE owner_thread_id != 9999999 AND owner_event_id = @target_event_id");
  eval CALL index_test($table, "WHERE owner_thread_id = 9999999 ORDER BY owner_thread_id");
}

# THREAD_ID, ERROR_NUMBER

IF ($key_group == 1.2)
{
  eval CALL index_test($table, "WHERE thread_id is null");
  eval CALL index_test($table, "WHERE thread_id is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE error_number != 9999999");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND error_number is null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND error_number is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND error_number = 99999999");
  eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
}

# USER, HOST, EVENT_NAME

IF ($key_group == 2)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and event_name is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and event_name is not null");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND event_name = 'impossible'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser' AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser' AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1' AND event_name = '$target_event_name'");
}

# USER, HOST

IF ($key_group == 2.1)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
  eval CALL index_test($table, "WHERE host = '$target_host'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
  #eval CALL index_test($table, "WHERE host != '$target_host' AND user != 'user1'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1'");
}

# PROCESSLIST_USER, PROCESSLIST_HOST

IF ($key_group == 2.1.1)
{
  eval CALL index_test($table, "WHERE processlist_user is null");
  eval CALL index_test($table, "WHERE processlist_user is not null");
  eval CALL index_test($table, "WHERE processlist_user = 'user1' and processlist_host is null");
  eval CALL index_test($table, "WHERE processlist_user = 'user1' and processlist_host is not null");
  eval CALL index_test($table, "WHERE processlist_host = '$target_host'");
  eval CALL index_test($table, "WHERE processlist_host = '$target_host' AND processlist_user= '$target_user'");
  eval CALL index_test($table, "WHERE processlist_host != '$target_host' AND processlist_user != '$target_user'");
  eval CALL index_test($table, "WHERE processlist_host = 'nohost' AND processlist_user= 'nouser'");
  eval CALL index_test($table, "WHERE processlist_host = '$target_host' AND processlist_user= 'nouser'");
  eval CALL index_test($table, "WHERE processlist_host = 'nohost' AND processlist_user= '$target_user'");
}

# USER, HOST, VARIABLE_NAME

IF ($key_group == 2.2)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and variable_name is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and variable_name is not null");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND variable_name = 'impossible'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser' AND variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser' AND variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1' AND variable_name = '$target_variable_name'");
}

# USER, HOST, ERROR_NUMBER

IF ($key_group == 2.3)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and error_number is null");
  eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and error_number is not null");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND error_number = '$target_error_number'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'user1' AND error_number = 999999");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'nouser' AND error_number = '$target_error_number'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND user= 'nouser' AND error_number = '$target_error_number'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND user= 'user1' AND error_number = '$target_error_number'");
}

# HOST, ERROR_NUMBER

IF ($key_group == 2.4)
{
  eval CALL index_test($table, "WHERE host is null");
  eval CALL index_test($table, "WHERE host is not null");
  eval CALL index_test($table, "WHERE host = '$target_host' and error_number is null");
  eval CALL index_test($table, "WHERE host = '$target_host' and error_number is not null");
  eval CALL index_test($table, "WHERE host = '$target_host'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND error_number = '$target_error_number'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND error_number = 999999");
  eval CALL index_test($table, "WHERE host = 'nohost' AND error_number = '$target_error_number'");
}

# USER, ERROR_NUMBER

IF ($key_group == 2.5)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and error_number is null");
  eval CALL index_test($table, "WHERE user = 'user1' and error_number is not null");
  eval CALL index_test($table, "WHERE user= 'user1'");
  eval CALL index_test($table, "WHERE user= 'user1' AND error_number = '$target_error_number'");
  eval CALL index_test($table, "WHERE user= 'user1' AND error_number = 999999");
  eval CALL index_test($table, "WHERE user= 'nouser' AND error_number = '$target_error_number'");
}

# ERROR_NUMBER

IF ($key_group == 2.6)
{
  eval CALL index_test($table, "WHERE error_number is null");
  eval CALL index_test($table, "WHERE error_number is not null");
  eval CALL index_test($table, "WHERE error_number = '$target_error_number'");
  eval CALL index_test($table, "WHERE error_number = '$target_error_number' ORDER BY error_number");
  eval CALL index_test($table, "WHERE error_number = '$target_error_number' ORDER BY error_number DESC");
  eval CALL index_test($table, "WHERE error_number > '$target_error_number'");
  eval CALL index_test($table, "WHERE error_number < '$target_error_number'");
  eval CALL index_test($table, "WHERE error_number >= '$target_error_number'");
  eval CALL index_test($table, "WHERE error_number <= '$target_error_number'");
}

# USER, HOST, ROLE

IF ($key_group == 2.7)
{
   eval CALL index_test($table, "WHERE user is null");
   eval CALL index_test($table, "WHERE user is not null");
   eval CALL index_test($table, "WHERE user = 'user1' and host is null");
   eval CALL index_test($table, "WHERE user = 'user1' and host is not null");
   eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and `role` is null");
   eval CALL index_test($table, "WHERE user = 'user1' and host = '$target_host' and `role` is not null");
   eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'user1'");
   eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'user1' AND `role` = '%'");
   eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'user1' AND `role` = 'impossible'");
   eval CALL index_test($table, "WHERE host = 'nohost' AND user = 'nouser' AND `role` = '%'");
   eval CALL index_test($table, "WHERE host = '$target_host' AND user = 'nouser' AND `role` = '%'");
   eval CALL index_test($table, "WHERE host = 'nohost' AND user = 'user1' AND `role` = '%'");
}

# USER, EVENT_NAME

IF ($key_group == 3)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and event_name is null");
  eval CALL index_test($table, "WHERE user = 'user1' and event_name is not null");
  eval CALL index_test($table, "WHERE user= 'user1'");
  eval CALL index_test($table, "WHERE user= 'user1' AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE user= 'user1' AND event_name = 'impossible'");
  eval CALL index_test($table, "WHERE user= 'nouser' AND event_name = '$target_event_name'");
}

# USER, VARIABLE_NAME

IF ($key_group == 3.1)
{
  eval CALL index_test($table, "WHERE user is null");
  eval CALL index_test($table, "WHERE user is not null");
  eval CALL index_test($table, "WHERE user = 'user1' and variable_name is null");
  eval CALL index_test($table, "WHERE user = 'user1' and variable_name is not null");
  eval CALL index_test($table, "WHERE user= 'user1'");
  eval CALL index_test($table, "WHERE user= 'user1' AND variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE user= 'user1' AND variable_name = 'impossible'");
  eval CALL index_test($table, "WHERE user= 'nouser' AND variable_name = '$target_variable_name'");
}

# THREAD_ID, EVENT_NAME

IF ($key_group == 4)
{
  eval CALL index_test($table, "WHERE thread_id is null");
  eval CALL index_test($table, "WHERE thread_id is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id and event_name is null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id and event_name is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE event_name != '$target_event_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name != '$target_event_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = 'impossible'");
  eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
}

# FIXME

IF ($key_group == 4.1)
{
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND event_name = 'impossible'");
  eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
}

# EVENT_NAME

IF ($key_group == 5)
{
  eval CALL index_test($table, "WHERE event_name is null");
  eval CALL index_test($table, "WHERE event_name is not null");
  eval CALL index_test($table, "WHERE event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE event_name != '$target_event_name'");
  eval CALL index_test($table, "WHERE event_name = 'impossible'");
  eval CALL index_test($table, "WHERE event_name != 'impossible' ORDER BY event_name DESC");
}

# FIXME
# EVENT_NAME (for events with only 1 class)

IF ($key_group == 5.1)
{
  eval CALL index_test($table, "WHERE event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE event_name = 'impossible'");
  eval CALL index_test($table, "WHERE event_name != 'impossible' ORDER BY event_name DESC");
}

# HOST, EVENT_NAME

IF ($key_group == 6)
{
  eval CALL index_test($table, "WHERE host is null");
  eval CALL index_test($table, "WHERE host is not null");
  eval CALL index_test($table, "WHERE host = '$target_host' and event_name is null");
  eval CALL index_test($table, "WHERE host = '$target_host' and event_name is not null");
  eval CALL index_test($table, "WHERE host = '$target_host'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND event_name = '$target_event_name'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND event_name = 'impossible'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND event_name = '$target_event_name'");
}

# HOST, VARIABLE_NAME

IF ($key_group == 6.1)
{
  eval CALL index_test($table, "WHERE host is null");
  eval CALL index_test($table, "WHERE host is not null");
  eval CALL index_test($table, "WHERE host = '$target_host' and variable_name is null");
  eval CALL index_test($table, "WHERE host = '$target_host' and variable_name is not null");
  eval CALL index_test($table, "WHERE host = '$target_host'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE host = '$target_host' AND variable_name = 'impossible'");
  eval CALL index_test($table, "WHERE host = 'nohost' AND variable_name = '$target_variable_name'");
}

# HOST

IF ($key_group == 6.2)
{
  eval CALL index_test($table, "WHERE host = '$target_host'");
  eval CALL index_test($table, "WHERE host IS NULL");
  eval CALL index_test($table, "WHERE host IS NOT NULL");
  eval CALL index_test($table, "WHERE host = 'nohost'");
}

# PROCESSLIST_HOST

IF ($key_group == 6.3)
{
  eval CALL index_test($table, "WHERE processlist_host = '$target_host'");
  eval CALL index_test($table, "WHERE processlist_host IS NULL");
  eval CALL index_test($table, "WHERE processlist_host IS NOT NULL");
  eval CALL index_test($table, "WHERE processlist_host = 'nohost'");
}

# THREAD_ID, VARIABLE_NAME

IF ($key_group == 7)
{
  eval CALL index_test($table, "WHERE thread_id is null");
  eval CALL index_test($table, "WHERE thread_id is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id and variable_name is null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id and variable_name is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND variable_name != '$target_variable_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND variable_name = 'impossible'");
  eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
}

# VARIABLE_NAME

IF ($key_group == 8)
{
  eval CALL index_test($table, "WHERE variable_name is null");
  eval CALL index_test($table, "WHERE variable_name is not null");
  eval CALL index_test($table, "WHERE variable_name = '$target_variable_name'");
  eval CALL index_test($table, "WHERE variable_name != '$target_variable_name'");
  eval CALL index_test($table, "WHERE variable_name = 'impossible'");
  eval CALL index_test($table, "WHERE variable_name != 'impossible' ORDER BY variable_name DESC");
}

# THREAD_ID, NAME

IF ($key_group == 9)
{
  eval CALL index_test($table, "WHERE thread_id is null");
  eval CALL index_test($table, "WHERE thread_id is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id and name is null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id and name is not null");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id ORDER BY thread_id DESC");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND name = '$target_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND name != '$target_name'");
  eval CALL index_test($table, "WHERE thread_id = @target_thread_id AND name = 'impossible'");
  eval CALL index_test($table, "WHERE thread_id > @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id < @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id >= @target_thread_id");
  eval CALL index_test($table, "WHERE thread_id <= @target_thread_id");
}

# PROCESSLIST_ID, ATTR_NAME -- Multiple connections

IF ($key_group == 9.1)
{
  eval CALL index_test($table, "WHERE processlist_id is null");
  eval CALL index_test($table, "WHERE processlist_id is not null");
  eval CALL index_test($table, "WHERE processlist_id = @target_id and attr_name is null");
  eval CALL index_test($table, "WHERE processlist_id = @target_id and attr_name is not null");
  eval CALL index_test($table, "WHERE processlist_id = @target_id");
  eval CALL index_test($table, "WHERE processlist_id = @target_id ORDER BY processlist_id DESC");
  eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = '$target_name'");
  eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name != '$target_name'");
  eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = 'impossible'");
  eval CALL index_test($table, "WHERE processlist_id > @target_id");
  eval CALL index_test($table, "WHERE processlist_id < @target_id");
  eval CALL index_test($table, "WHERE processlist_id >= @target_id");
  eval CALL index_test($table, "WHERE processlist_id <= @target_id");
}

# FIXME
# PROCESSLIST_ID, ATTR_NAME -- Current connection

IF ($key_group == 9.2)
{
  eval CALL index_test($table, "WHERE processlist_id = @target_id");
  eval CALL index_test($table, "WHERE attr_name != '$target_name'");
  eval CALL index_test($table, "WHERE processlist_id = @target_id ORDER BY processlist_id DESC");
  eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = '$target_name'");
  eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name != '$target_name'");
  eval CALL index_test($table, "WHERE processlist_id = @target_id AND attr_name = 'impossible'");
  eval CALL index_test($table, "WHERE processlist_id > @target_id");
  eval CALL index_test($table, "WHERE processlist_id < @target_id");
  eval CALL index_test($table, "WHERE processlist_id >= @target_id");
  eval CALL index_test($table, "WHERE processlist_id <= @target_id");
  eval CALL index_test($table, "WHERE processlist_id > 9999999");
  eval CALL index_test($table, "WHERE processlist_id < 9999999");
  eval CALL index_test($table, "WHERE processlist_id >= 9999999");
  eval CALL index_test($table, "WHERE processlist_id <= 9999999");
}

# OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME

IF ($key_group == 10)
{
  eval CALL index_test($table, "WHERE object_type is null");
  eval CALL index_test($table, "WHERE object_type is not null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is not null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is not null");
  eval CALL index_test($table, "WHERE object_type = '$target_type'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name'");
  eval CALL index_test($table, "WHERE object_type = 'impossible' AND object_schema = '$target_schema' AND object_name = '$target_name'");
  eval CALL index_test($table, "WHERE object_type = 'impossible'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = 'impossible'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = 'impossible'");
}

# OWNER_OBJECT_TYPE, OWNER_OBJECT_SCHEMA, OWNER_OBJECT_NAME

IF ($key_group == 10.1)
{
  eval CALL index_test($table, "WHERE owner_object_type is null");
  eval CALL index_test($table, "WHERE owner_object_type is not null");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema is null");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema is not null");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema = '$target_schema' and owner_object_name is null");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' and owner_object_schema = '$target_schema' and owner_object_name is not null");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type'");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = '$target_schema'");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = '$target_schema' AND owner_object_name = '$target_name'");
  eval CALL index_test($table, "WHERE owner_object_type = 'impossible' AND owner_object_schema = '$target_schema' AND owner_object_name = '$target_name'");
  eval CALL index_test($table, "WHERE owner_object_type = 'impossible'");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = 'impossible'");
  eval CALL index_test($table, "WHERE owner_object_type = '$target_type' AND owner_object_schema = '$target_schema' AND owner_object_name = 'impossible'");
}

# OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME

IF ($key_group == 11)
{
  eval CALL index_test($table, "WHERE object_type is null");
  eval CALL index_test($table, "WHERE object_type is not null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema is not null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is null");
  eval CALL index_test($table, "WHERE object_type = '$target_type' and object_schema = '$target_schema' and object_name is not null");
  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");
  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");
  eval CALL index_test($table, "WHERE object_type = '$target_type'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name'");
  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'");
  eval CALL index_test($table, "WHERE object_type = 'impossible' AND object_schema = '$target_schema' AND object_name = '$target_name'");
  eval CALL index_test($table, "WHERE object_type = 'impossible'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = 'impossible'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = 'impossible'");
  eval CALL index_test($table, "WHERE object_type = '$target_type' AND object_schema = '$target_schema' AND object_name = '$target_name' AND index_name = 'impossible'");
}

# OBJECT_INSTANCE_BEGIN

IF ($key_group == 12)
{
  eval CALL index_test($table, "WHERE object_instance_begin is null");
  eval CALL index_test($table, "WHERE object_instance_begin is not null");
  eval CALL index_test($table, "WHERE object_instance_begin = @object_instance_begin");

  # NOTE: The following test is disabled for metadata locks because it will give
  # a different number of locks for indexed and non-indexed access. The
  # non-indexed access will try to use histogram statistics, and will thus use
  # one more metadata lock.
  IF ($table != "metadata_locks")
  {
    eval CALL index_test($table, "WHERE object_instance_begin != @object_instance_begin");
  }

  eval CALL index_test($table, "WHERE object_instance_begin = '9999999999'");
}

# GENERIC NAME - EVENT_NAME / NAME / STATEMENT_NAME

IF ($key_group == 13)
{
  eval CALL index_test($table, "WHERE $name_column is null");
  eval CALL index_test($table, "WHERE $name_column is not null");
  eval CALL index_test($table, "WHERE $name_column = '$target_name'");
  eval CALL index_test($table, "WHERE $name_column != '$target_name'");
  eval CALL index_test($table, "WHERE $name_column = 'impossible'");
  eval CALL index_test($table, "WHERE $name_column != 'impossible' ORDER BY $name_column DESC");
}

# FIXME
# FILE_NAME

IF ($key_group == 13.1)
{
  eval CALL index_test($table, "WHERE $name_column = @target_name");
  eval CALL index_test($table, "WHERE $name_column != @target_name");
  eval CALL index_test($table, "WHERE $name_column = 'impossible'");
  eval CALL index_test($table, "WHERE $name_column != 'impossible' ORDER BY $name_column DESC");
}

# GENERIC ID - THREAD_ID / LOCKED_BY_THREAD_ID / STATEMENT_ID / SOCKET_ID

IF ($key_group == 14)
{
  eval CALL index_test($table, "WHERE $id_column is null");
  eval CALL index_test($table, "WHERE $id_column is not null");
  eval CALL index_test($table, "WHERE $id_column = @target_id");
  eval CALL index_test($table, "WHERE $id_column = @target_id ORDER BY $id_column");
  eval CALL index_test($table, "WHERE $id_column = @target_id ORDER BY $id_column DESC");
  eval CALL index_test($table, "WHERE $id_column = 9999999 ORDER BY $id_column");
}

# IP

IF ($key_group == 15)
{
  eval CALL index_test($table, "WHERE IP is null");
  eval CALL index_test($table, "WHERE IP is not null");
  eval CALL index_test($table, "WHERE IP = '$target_ip'");
  #eval CALL index_test($table, "WHERE IP != '$target_ip'");
  eval CALL index_test($table, "WHERE IP = 'impossible'");
}

# PORT

IF ($key_group == 16)
{
  eval CALL index_test($table, "WHERE port is null");
  eval CALL index_test($table, "WHERE port is not null");
  eval CALL index_test($table, "WHERE port = @target_port");
  eval CALL index_test($table, "WHERE port = @target_port ORDER BY port");
  eval CALL index_test($table, "WHERE port = 9999999");
  eval CALL index_test($table, "WHERE port > 9999999");
  eval CALL index_test($table, "WHERE port < 9999999");
  eval CALL index_test($table, "WHERE port >= 9999999");
  eval CALL index_test($table, "WHERE port <= 9999999");
}

# IP, PORT

IF ($key_group == 16.1)
{
  eval CALL index_test($table, "WHERE IP is null");
  eval CALL index_test($table, "WHERE IP is not null");
  eval CALL index_test($table, "WHERE IP = '$target_ip' and port is null");
  eval CALL index_test($table, "WHERE IP = '$target_ip' and port is not null");
  eval CALL index_test($table, "WHERE IP = '$target_ip'");
  eval CALL index_test($table, "WHERE IP = 'impossible'");
  eval CALL index_test($table, "WHERE IP = '$target_ip' AND port = @target_port");
  eval CALL index_test($table, "WHERE IP = '$target_ip' AND port = 9999999");
  eval CALL index_test($table, "WHERE IP = 'impossible' AND port = @target_port");
  eval CALL index_test($table, "WHERE port = @target_port");
}

# SCHEMA_NAME, DIGEST

IF ($key_group == 17)
{
  eval CALL index_test($table, "WHERE schema_name is null");
  eval CALL index_test($table, "WHERE schema_name is not null");
  eval CALL index_test($table, "WHERE schema_name = '$target_schema' and digest is null");
  eval CALL index_test($table, "WHERE schema_name = '$target_schema' and digest is not null");
  eval CALL index_test($table, "WHERE schema_name = '$target_schema'");
  eval CALL index_test($table, "WHERE schema_name != '$target_schema'");
  eval CALL index_test($table, "WHERE schema_name = '$target_schema' AND digest = @target_digest");
  eval CALL index_test($table, "WHERE schema_name = '$target_schema' AND digest = 'impossible'");
  eval CALL index_test($table, "WHERE schema_name = 'noschema_name' AND digest = @target_digest");
}

# CHANNEL_NAME

IF ($key_group == 18)
{
  eval CALL index_test($table, "WHERE CHANNEL_NAME is null");
  eval CALL index_test($table, "WHERE CHANNEL_NAME is not null");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name");
  eval CALL index_test($table, "WHERE CHANNEL_NAME != $target_channel_name");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = 'impossible'");
  eval CALL index_test($table, "WHERE CHANNEL_NAME != 'impossible' ORDER BY CHANNEL_NAME DESC");
}

# CHANNEL_NAME, WORKER_ID

IF ($key_group == 18.1)
{
  eval CALL index_test($table, "WHERE CHANNEL_NAME is null");
  eval CALL index_test($table, "WHERE CHANNEL_NAME is not null");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name");
  eval CALL index_test($table, "WHERE CHANNEL_NAME != $target_channel_name");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = 'impossible'");
  eval CALL index_test($table, "WHERE CHANNEL_NAME != 'impossible' ORDER BY CHANNEL_NAME DESC");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID is null");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID is not null");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID = $target_worker_id");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID != $target_worker_id");
  eval CALL index_test($table, "WHERE CHANNEL_NAME = $target_channel_name AND WORKER_ID = 9999");
}

--enable_query_log