Debian Codegraph @

mysql-test/suite/perfschema/t/processlist_misc.test

raw
1 --echo ##
2 --echo ## Miscellaneous test cases for performance_schema.processlist
3 --echo ##
4 --echo ## Test cases:
5 --echo ## 1. Verify naming of foreground system threads.
6 --echo ##
7 --echo
8 --echo ##
9 --echo ## Test Case 1: Verify naming of foreground system threads.
10 --echo ##
11 --echo ## Foreground system threads should be named 'system user' except for
12 --echo ## singleton threads such as 'event_scheduler'.
13 --echo ##
14 --echo ## Reference: Bug#36895513 "Wrong result in P_S.processlist on replica node"
15 --echo ## NOTE: Results must be manually verified.
16 --echo ##
17
18 --source include/no_protocol.inc
19 --echo
20 --echo # Configure two servers to be source and replica.
21 --source include/master-slave.inc
22 --echo
23 --echo # Wait until the replica SQL thread has been synced and all events have been copied over to the replica.
24 --source include/sync_slave_sql_with_master.inc
25
26 --echo
27 --echo # Stop replica.
28 --source include/stop_slave.inc
29 --echo
30 --echo # Start replica.
31 --source include/start_slave.inc
32
33 --echo
34 --echo # Verify processlist user name is 'system_user'.
35 --echo
36 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
37 --replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
38 select * from performance_schema.processlist order by user, id;
39
40 --echo
41 --echo # Create user 'test_processlist' then restart the replica and verify that
42 --echo # the processlist user name for the replica threads is 'system user'.
43 --echo
44 CREATE USER 'test_processlist'@'localhost';
45 GRANT ALL ON *.* TO 'test_processlist'@'localhost';
46
47 --echo
48 --echo # Stop replica.
49 --source include/stop_slave.inc
50 --echo
51 --echo # Connect as 'test_processlist'.
52 --connect(processlist_slave, localhost, test_processlist,,, $SLAVE_MYPORT,$SLAVE_MYSOCK)
53 --echo
54 --echo # Start replica as user 'test_processlist'.
55 --source include/start_slave.inc
56
57 --echo
58 --echo # Verify processlist user name is 'system_user' for the replica threads.
59 --echo
60 --replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
61 --replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
62 select * from performance_schema.processlist order by user, id;
63
64 --echo
65 --echo # Clean up.
66 --echo
67 DROP USER 'test_processlist'@'localhost';
68
69 --source include/rpl_end.inc