1 # Tests for the performance schema
7 # Verify how connections are counted into various tables:
12 # The tests are written with the following helpers:
13 # - include/connection_setup.inc
14 # - include/connection_load.inc
15 # - include/connection_cleanup.inc
17 # Helpers are intended to be used as follows.
19 # A Typical test t/connection_xxx.test will consist of:
20 # --source ../include/connection_setup.inc
21 # --source ../include/connection_load.inc
22 # --source ../include/connection_cleanup.inc
23 # and a t/connection_xxx-master.opt file
25 # Naming conventions for t/connection_xxx.test are as follows:
26 # t/connection_<account><user><host>
28 # <account> corresponds to different sizing settings for
29 # the variable performance-schema-accounts-size
30 # - (blank): accounts-size sufficient to represent all records
31 # - 3a: accounts-size set to 3
32 # - no_a: accounts-size set to 0
34 # <user> corresponds to different sizing settings for
35 # the variable performance-schema-users-size
36 # - (blank): users-size sufficient to represent all records
37 # - 3u: users-size set to 3
38 # - no_u: users-size set to 0
40 # <host> corresponds to different sizing settings for
41 # the variable performance-schema-hosts-size
42 # - (blank): hosts-size sufficient to represent all records
43 # - no_h: hosts-size set to 0
45 # ========================================
46 # HELPER include/event_aggregate_setup.inc
47 # ========================================
49 --source include/not_embedded.inc
50 --source include/have_perfschema.inc
51 --source ../include/no_protocol.inc
52 --source ../include/wait_for_pfs_thread_count.inc
56 grant ALL on *.*
to user1@localhost;
57 grant ALL on *.*
to user2@localhost;
58 grant ALL on *.*
to user3@localhost;
59 grant ALL on *.*
to user4@localhost;
60 grant ALL on *.*
to user5@localhost;
64 # Purge old users, hosts, user/host from previous tests
65 truncate
table performance_schema.accounts;
66 truncate
table performance_schema.users;
67 truncate
table performance_schema.hosts;
71 # Start from a known clean state, to avoid noise from previous tests
76 drop procedure
if exists dump_all;
81 create procedure dump_all()
83 select processlist_user, processlist_host
84 from performance_schema.threads
85 where (processlist_user is not null) and (processlist_host is not null)
86 order by processlist_user;
88 select * from performance_schema.accounts
89 where (user is not null) and (host is not null)
92 select * from performance_schema.users
93 where user is not null
96 select * from performance_schema.hosts
97 where host is not null
100 select variable_name, variable_value from information_schema.global_status
101 where variable_name in ('PERFORMANCE_SCHEMA_ACCOUNTS_LOST',
102 'PERFORMANCE_SCHEMA_USERS_LOST',
103 'PERFORMANCE_SCHEMA_HOSTS_LOST');