File: processlist_misc.test

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 (69 lines) | stat: -rw-r--r-- 2,198 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
--echo ##
--echo ## Miscellaneous test cases for performance_schema.processlist
--echo ##
--echo ## Test cases:
--echo ##   1. Verify naming of foreground system threads.
--echo ##
--echo
--echo ##
--echo ## Test Case 1: Verify naming of foreground system threads.
--echo ##
--echo ## Foreground system threads should be named 'system user' except for 
--echo ## singleton threads such as 'event_scheduler'.
--echo ##
--echo ## Reference: Bug#36895513 "Wrong result in P_S.processlist on replica node"
--echo ## NOTE: Results must be manually verified.
--echo ##

--source include/no_protocol.inc
--echo
--echo # Configure two servers to be source and replica.
--source include/master-slave.inc
--echo
--echo # Wait until the replica SQL thread has been synced and all events have been copied over to the replica.
--source include/sync_slave_sql_with_master.inc

--echo
--echo # Stop replica.
--source include/stop_slave.inc
--echo
--echo # Start replica.
--source include/start_slave.inc

--echo
--echo # Verify processlist user name is 'system_user'.
--echo
--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
select * from performance_schema.processlist order by user, id;

--echo
--echo # Create user 'test_processlist' then restart the replica and verify that
--echo # the processlist user name for the replica threads is 'system user'.
--echo
CREATE USER 'test_processlist'@'localhost';
GRANT ALL ON *.* TO 'test_processlist'@'localhost';

--echo
--echo # Stop replica.
--source include/stop_slave.inc
--echo
--echo # Connect as 'test_processlist'.
--connect(processlist_slave, localhost, test_processlist,,, $SLAVE_MYPORT,$SLAVE_MYSOCK)
--echo
--echo # Start replica as user 'test_processlist'.
--source include/start_slave.inc

--echo
--echo # Verify processlist user name is 'system_user' for the replica threads.
--echo
--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
--replace_regex /Daemon/<Command>/ /Connect/<Command>/ /Sleep/<Command>/
select * from performance_schema.processlist order by user, id;

--echo
--echo # Clean up.
--echo
DROP USER 'test_processlist'@'localhost';

--source include/rpl_end.inc