Debian Codegraph @

mysql-test/suite/x/include/performance_schema_assert_empty_worker_threads.inc

raw
1 # Assert empty values in columns of performance_schema.thread table
2 #
3 # The columns must be empty when there is no user on
4 # X connection. This include file is dedicated for
5 # performance_schema_threads.test
6 #
7 # Usage:
8 # --source ../include/performance_schema_assert_empty_worker_threads.inc
9 #
10
11 --echo #
12 --echo # Get actual number of worker threads
13 --echo #
14
15 let $wait_condition= SELECT COUNT(*)=@@mysqlx_min_worker_threads FROM performance_schema.threads
16 WHERE name LIKE "thread/mysqlx/worker";
17 source include/wait_condition_or_abort.inc;
18
19 let $thread_entries=`SELECT @@mysqlx_min_worker_threads`;
20
21 let $assert_text= X Plugin must have idle worker threads;
22 let $assert_cond= [SELECT $thread_entries as `Result`, Result, 1] > 0;
23 --source include/assert.inc
24
25 --echo #
26 --echo # Assert all significant columns in thread table
27 --echo #
28 let $assert_text= All workers must have NULL in field `CONNECTION_TYPE`;
29 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
30 WHERE `name` LIKE "thread/mysqlx/worker" and `CONNECTION_TYPE` is NULL, Result, 1] = $thread_entries;
31 --source include/assert.inc
32
33 let $assert_text= All workers must have NULL in field `PROCESSLIST_USER`;
34 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
35 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_USER` is NULL, Result, 1] = $thread_entries;
36 --source include/assert.inc
37
38 let $assert_text= All workers must have NULL in field `PROCESSLIST_HOST`;
39 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
40 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_HOST` is NULL, Result, 1] = $thread_entries;
41 --source include/assert.inc
42
43 let $assert_text= All workers must have NULL in field `PROCESSLIST_DB`;
44 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
45 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_DB` is NULL, Result, 1] = $thread_entries;
46 --source include/assert.inc
47
48 let $assert_text= All workers must have NULL in field `PROCESSLIST_COMMAND`;
49 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
50 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_COMMAND` is NULL, Result, 1] = $thread_entries;
51 --source include/assert.inc
52
53 let $assert_text= All workers must have NULL in field `PROCESSLIST_TIME`;
54 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
55 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_TIME` is NULL, Result, 1] = $thread_entries;
56 --source include/assert.inc
57
58 let $assert_text= All workers must have NULL in field `PROCESSLIST_STATE`;
59 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
60 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_STATE` is NULL, Result, 1] = $thread_entries;
61 --source include/assert.inc
62
63 let $assert_text= All workers must have NULL in field `PROCESSLIST_INFO`;
64 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
65 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_INFO` is NULL, Result, 1] = $thread_entries;
66 --source include/assert.inc
67
68 let $assert_text= All workers must have NULL in field `PROCESSLIST_COMMAND`;
69 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
70 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_COMMAND` is NULL, Result, 1] = $thread_entries;
71 --source include/assert.inc
72
73 let $assert_text= All workers must have NULL in field `PROCESSLIST_ID`;
74 let $assert_cond= [SELECT COUNT(*) as `Result` FROM `performance_schema`.`threads`
75 WHERE `name` LIKE "thread/mysqlx/worker" and `PROCESSLIST_ID` is NULL, Result, 1] = $thread_entries;
76 --source include/assert.inc