Debian Codegraph @

mysql-test/suite/perfschema/r/processlist_port.result

raw
1 ##
2 ## Test the Performance Schema-based implementation of SHOW PROCESSLIST.
3 ##
4 ## Verify the Host field (hostname:port) against the legacy implementation.
5 ##
6
7 ### Setup ###
8
9 select @@global.performance_schema_show_processlist into @save_processlist;
10
11 # Control user
12 create user user0@localhost;
13 grant ALL on *.* to user0@localhost;
14 # Test users
15
16 create user user1@localhost, user2@localhost,
17 user3@localhost, user4@localhost;
18
19 grant USAGE on *.* to user1@localhost;
20 grant ALL on *.* to user2@localhost;
21 grant ALL on *.* to user3@localhost;
22 grant ALL on *.* to user4@localhost;
23
24 flush privileges;
25
26 show grants for user1@localhost;
27 Grants for user1@localhost
28 GRANT USAGE ON *.* TO 'user1'@'localhost'
29
30 # Connect (con_user0, 127.0.0.1, user0, , , MASTER_MYPORT, )
31
32 select connection_id() into @con_user0_id;
33 # Connect (con_user1, 127.0.0.1, user1, , , MASTER_MYPORT, )
34 # Connect (con_user2, 127.0.0.1, user2, , , MASTER_MYPORT, )
35 # Connect (con_user3, 127.0.0.1, user3, , , MASTER_MYPORT, )
36 # Connect (con_user4, 127.0.0.1, user4, , , MASTER_MYPORT, )
37 # Connection user0
38
39 ### Compare the SHOW PROCESSLIST Host column between the new and old implementations
40
41 ## New SHOW PROCESSLIST
42 set @@global.performance_schema_show_processlist = on;
43
44 SHOW FULL PROCESSLIST;
45 Id User Host db Command Time State Info
46 <Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
47 <Id> root <Host> test <Command> <Time> <State> NULL
48 <Id> user0 <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
49 <Id> user1 <Host> test <Command> <Time> <State> NULL
50 <Id> user2 <Host> test <Command> <Time> <State> NULL
51 <Id> user3 <Host> test <Command> <Time> <State> NULL
52 <Id> user4 <Host> test <Command> <Time> <State> NULL
53
54 # Performance Schema processlist table
55
56 select * from performance_schema.processlist order by user, id;
57 ID USER HOST DB COMMAND TIME STATE INFO
58 <Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
59 <Id> root <Host> test <Command> <Time> <State> NULL
60 <Id> user0 <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
61 <Id> user1 <Host> test <Command> <Time> <State> NULL
62 <Id> user2 <Host> test <Command> <Time> <State> NULL
63 <Id> user3 <Host> test <Command> <Time> <State> NULL
64 <Id> user4 <Host> test <Command> <Time> <State> NULL
65
66 # Information Schema processlist table
67
68 select * from information_schema.processlist order by user, id;
69 ID USER HOST DB COMMAND TIME STATE INFO
70 <Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
71 <Id> root <Host> test <Command> <Time> <State> NULL
72 <Id> user0 <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
73 <Id> user1 <Host> test <Command> <Time> <State> NULL
74 <Id> user2 <Host> test <Command> <Time> <State> NULL
75 <Id> user3 <Host> test <Command> <Time> <State> NULL
76 <Id> user4 <Host> test <Command> <Time> <State> NULL
77
78 # Connection user1
79 # Get Host:Port, new
80
81 ## Legacy SHOW PROCESSLIST
82 set @@global.performance_schema_show_processlist = off;
83
84 SHOW FULL PROCESSLIST;
85 Id User Host db Command Time State Info
86 <Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
87 <Id> root <Host> test <Command> <Time> <State> NULL
88 <Id> user0 <Host> test Query <Time> <State> SHOW FULL PROCESSLIST
89 <Id> user1 <Host> test <Command> <Time> <State> NULL
90 <Id> user2 <Host> test <Command> <Time> <State> NULL
91 <Id> user3 <Host> test <Command> <Time> <State> NULL
92 <Id> user4 <Host> test <Command> <Time> <State> NULL
93
94 # Performance Schema processlist table
95
96 select * from performance_schema.processlist order by user, id;
97 ID USER HOST DB COMMAND TIME STATE INFO
98 <Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
99 <Id> root <Host> test <Command> <Time> <State> NULL
100 <Id> user0 <Host> test Query <Time> <State> select * from performance_schema.processlist order by user, id
101 <Id> user1 <Host> test <Command> <Time> <State> NULL
102 <Id> user2 <Host> test <Command> <Time> <State> NULL
103 <Id> user3 <Host> test <Command> <Time> <State> NULL
104 <Id> user4 <Host> test <Command> <Time> <State> NULL
105
106 # Information Schema processlist table
107
108 select * from information_schema.processlist order by user, id;
109 ID USER HOST DB COMMAND TIME STATE INFO
110 <Id> event_scheduler <Host> NULL <Command> <Time> <State> NULL
111 <Id> root <Host> test <Command> <Time> <State> NULL
112 <Id> user0 <Host> test Query <Time> <State> select * from information_schema.processlist order by user, id
113 <Id> user1 <Host> test <Command> <Time> <State> NULL
114 <Id> user2 <Host> test <Command> <Time> <State> NULL
115 <Id> user3 <Host> test <Command> <Time> <State> NULL
116 <Id> user4 <Host> test <Command> <Time> <State> NULL
117
118 # Connection user1
119 # Get Host:Port, legacy
120
121 ***SUCCESS*** The SHOW PROCESSLIST Host fields match
122
123 ### Compare the processlist Host column between Performance Schema and the Information Schema
124
125 # Connection con_user0
126
127 ***SUCCESS*** The processlist Host fields match between the Performance Schema and the Information Schema
128
129
130 ### Clean up ###
131
132 # Disconnect con_user0
133 # Disconnect con_user1
134 # Disconnect con_user2
135 # Disconnect con_user3
136 # Disconnect con_user4
137 # Connection default
138
139 drop user user0@localhost;
140 drop user user1@localhost;
141 drop user user2@localhost;
142 drop user user3@localhost;
143 drop user user4@localhost;
144
145 set @@global.performance_schema_show_processlist = @save_processlist;