Debian Codegraph @

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

raw
1 select * from performance_schema.setup_actors;
2 HOST USER ROLE ENABLED HISTORY
3 % % % YES YES
4 truncate table performance_schema.setup_actors;
5 insert into performance_schema.setup_actors
6 values ('localhost', 'user1', '%', 'YES', 'YES');
7 insert into performance_schema.setup_actors
8 values ('localhost', 'user2', '%', 'NO', 'NO');
9 set @orig_sql_mode= @@sql_mode;
10 set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
11 grant ALL on *.* to user1@localhost;
12 grant ALL on *.* to user2@localhost;
13 set sql_mode= @orig_sql_mode;
14 flush privileges;
15 # Switch to (con1, localhost, user1, , )
16 connect con1, localhost, user1, , ;
17 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
18 from performance_schema.threads
19 where PROCESSLIST_ID = connection_id();
20 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
21 thread/sql/one_connection FOREGROUND YES user1 localhost
22 # Switch to (con2, localhost, user2, , )
23 connect con2, localhost, user2, , ;
24 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
25 from performance_schema.threads
26 where PROCESSLIST_ID = connection_id();
27 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
28 thread/sql/one_connection FOREGROUND NO user2 localhost
29 # Switch to connection default
30 connection default;
31 update performance_schema.setup_actors set ENABLED='NO' where USER='user1';
32 update performance_schema.setup_actors set ENABLED='YES' where USER='user2';
33 # Switch to connection con1
34 connection con1;
35 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
36 from performance_schema.threads
37 where PROCESSLIST_ID = connection_id();
38 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
39 thread/sql/one_connection FOREGROUND YES user1 localhost
40 # Switch to connection con2
41 connection con2;
42 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
43 from performance_schema.threads
44 where PROCESSLIST_ID = connection_id();
45 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
46 thread/sql/one_connection FOREGROUND NO user2 localhost
47 # Disconnect con1 and con2
48 disconnect con1;
49 disconnect con2;
50 # Switch to (con1, localhost, user1, , )
51 connect con1, localhost, user1, , ;
52 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
53 from performance_schema.threads
54 where PROCESSLIST_ID = connection_id();
55 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
56 thread/sql/one_connection FOREGROUND NO user1 localhost
57 # Switch to (con2 localhost, user2, , )
58 connect con2, localhost, user2, , ;
59 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
60 from performance_schema.threads
61 where PROCESSLIST_ID = connection_id();
62 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
63 thread/sql/one_connection FOREGROUND YES user2 localhost
64 # Disconnect con1 and con2
65 disconnect con1;
66 disconnect con2;
67 # Switch to connection default
68 connection default;
69 revoke update on *.* from 'user2'@'localhost';
70 flush privileges;
71 # Switch to (con2 localhost, user2, , )
72 connect con2, localhost, user2, , ;
73 update performance_schema.setup_actors
74 set ENABLED='NO';
75 ERROR 42000: UPDATE command denied to user 'user2'@'localhost' for table `performance_schema`.`setup_actors`
76 disconnect con2;
77 connection default;
78 insert into performance_schema.setup_actors
79 values ('%', 'user1', '%', 'YES', 'YES');
80 insert into performance_schema.setup_actors
81 values ('localhost', '%', '%', 'NO', 'NO');
82 insert into performance_schema.setup_actors
83 values ('%', '%', '%', 'YES', 'YES');
84 # Switch to (con1, localhost, user1, , )
85 connect con1, localhost, user1, , ;
86 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
87 from performance_schema.threads
88 where PROCESSLIST_ID = connection_id();
89 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
90 thread/sql/one_connection FOREGROUND NO user1 localhost
91 disconnect con1;
92 connection default;
93 delete from performance_schema.setup_actors where
94 HOST='localhost' and USER='user1';
95 # Switch to (con1, localhost, user1, , )
96 connect con1, localhost, user1, , ;
97 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
98 from performance_schema.threads
99 where PROCESSLIST_ID = connection_id();
100 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
101 thread/sql/one_connection FOREGROUND YES user1 localhost
102 disconnect con1;
103 connection default;
104 delete from performance_schema.setup_actors where
105 HOST='%' and USER='user1';
106 # Switch to (con1, localhost, user1, , )
107 connect con1, localhost, user1, , ;
108 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
109 from performance_schema.threads
110 where PROCESSLIST_ID = connection_id();
111 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
112 thread/sql/one_connection FOREGROUND NO user1 localhost
113 disconnect con1;
114 connection default;
115 delete from performance_schema.setup_actors where
116 HOST='localhost' and USER='%';
117 # Switch to (con1, localhost, user1, , )
118 connect con1, localhost, user1, , ;
119 select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
120 from performance_schema.threads
121 where PROCESSLIST_ID = connection_id();
122 NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
123 thread/sql/one_connection FOREGROUND YES user1 localhost
124 disconnect con1;
125 connection default;
126 revoke all privileges, grant option from user1@localhost;
127 revoke all privileges, grant option from user2@localhost;
128 drop user user1@localhost;
129 drop user user2@localhost;
130 flush privileges;
131 truncate table performance_schema.setup_actors;
132 insert into performance_schema.setup_actors
133 values ('%', '%', '%', 'YES', 'YES');
134 select * from performance_schema.setup_actors;
135 HOST USER ROLE ENABLED HISTORY
136 % % % YES YES