Debian Codegraph @

mysql-test/suite/rpl/r/rpl_roles.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 CREATE ROLE r1, r2, r3;
7 CREATE USER u1@localhost;
8 GRANT r1 TO r2;
9 GRANT r2 TO u1@localhost;
10 GRANT r3 TO u1@localhost;
11 ALTER USER u1@localhost DEFAULT ROLE ALL;
12 include/sync_slave_sql_with_master.inc
13 SELECT * FROM mysql.default_roles;
14 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
15 localhost u1 % r2
16 localhost u1 % r3
17 SELECT * FROM mysql.role_edges;
18 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
19 % r1 % r2 N
20 % r2 localhost u1 N
21 % r3 localhost u1 N
22 [connection master]
23 REVOKE r3 FROM u1@localhost;
24 GRANT r1 TO u1@localhost;
25 ALTER USER u1@localhost DEFAULT ROLE r1;
26 include/sync_slave_sql_with_master.inc
27 SELECT * FROM mysql.default_roles;
28 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
29 localhost u1 % r1
30 SELECT * FROM mysql.role_edges;
31 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
32 % r1 % r2 N
33 % r1 localhost u1 N
34 % r2 localhost u1 N
35 [connection master]
36 ALTER USER u1@localhost DEFAULT ROLE NONE;
37 include/sync_slave_sql_with_master.inc
38 SELECT * FROM mysql.default_roles;
39 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
40 SELECT * FROM mysql.role_edges;
41 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
42 % r1 % r2 N
43 % r1 localhost u1 N
44 % r2 localhost u1 N
45 [connection master]
46 REVOKE r1 FROM r2;
47 include/sync_slave_sql_with_master.inc
48 SELECT * FROM mysql.default_roles;
49 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
50 SELECT * FROM mysql.role_edges;
51 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
52 % r1 localhost u1 N
53 % r2 localhost u1 N
54 include/stop_slave.inc
55 set sql_log_bin=0;
56 call mtr.add_suppression(".*Replica I/O for channel '': Source command COM_REGISTER_REPLICA failed.*");
57 call mtr.add_suppression(".*Replica I/O thread couldn't register on source");
58 set sql_log_bin=1;
59 [connection master]
60 CREATE ROLE r4;
61 GRANT REPLICATION SLAVE ON *.* TO r4;
62 GRANT r4 to u1@localhost;
63 SELECT * FROM mysql.default_roles;
64 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
65 SELECT * FROM mysql.role_edges;
66 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
67 % r1 localhost u1 N
68 % r2 localhost u1 N
69 % r4 localhost u1 N
70 [connection slave]
71 CHANGE REPLICATION SOURCE TO SOURCE_USER='u1';
72 Warnings:
73 Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
74 Note 1760 Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
75 START SLAVE;
76 Warnings:
77 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
78 include/wait_for_slave_io_error.inc [errno=13120]
79 [connection master]
80 ALTER USER u1@localhost DEFAULT ROLE ALL;
81 SELECT * FROM mysql.default_roles;
82 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
83 localhost u1 % r1
84 localhost u1 % r2
85 localhost u1 % r4
86 SELECT * FROM mysql.role_edges;
87 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
88 % r1 localhost u1 N
89 % r2 localhost u1 N
90 % r4 localhost u1 N
91 [connection slave]
92 START SLAVE IO_THREAD;
93 Warnings:
94 Warning 1287 'START SLAVE' is deprecated and will be removed in a future release. Please use START REPLICA instead
95 include/wait_for_slave_io_to_start.inc
96
97 # Verify if 'DEFAULT ROLE' clause is bin-logged.
98
99 [connection master]
100 connection master;
101 CREATE USER u2@localhost DEFAULT ROLE r1, r2;
102 CREATE USER u3@localhost DEFAULT ROLE r1;
103
104 SHOW GRANTS FOR u2@localhost;
105 Grants for u2@localhost
106 GRANT USAGE ON *.* TO `u2`@`localhost`
107 GRANT `r1`@`%`,`r2`@`%` TO `u2`@`localhost`
108
109 SHOW GRANTS FOR u3@localhost;
110 Grants for u3@localhost
111 GRANT USAGE ON *.* TO `u3`@`localhost`
112 GRANT `r1`@`%` TO `u3`@`localhost`
113 include/sync_slave_sql_with_master.inc
114 connection master;
115 connection slave;
116 connection slave;
117 SHOW GRANTS FOR u2@localhost;
118 Grants for u2@localhost
119 GRANT USAGE ON *.* TO `u2`@`localhost`
120 GRANT `r1`@`%`,`r2`@`%` TO `u2`@`localhost`
121 SHOW GRANTS FOR u3@localhost;
122 Grants for u3@localhost
123 GRANT USAGE ON *.* TO `u3`@`localhost`
124 GRANT `r1`@`%` TO `u3`@`localhost`
125
126 SHOW CREATE USER u2@localhost;
127 CREATE USER for u2@localhost
128 CREATE USER `u2`@`localhost` IDENTIFIED WITH 'caching_sha2_password' DEFAULT ROLE `r1`@`%`,`r2`@`%` REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT
129 SHOW CREATE USER u3@localhost;
130 CREATE USER for u3@localhost
131 CREATE USER `u3`@`localhost` IDENTIFIED WITH 'caching_sha2_password' DEFAULT ROLE `r1`@`%` REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT
132 [connection master]
133 connection master;
134
135 ALTER USER u2@localhost DEFAULT ROLE NONE;
136 SHOW GRANTS FOR u3@localhost;
137 Grants for u3@localhost
138 GRANT USAGE ON *.* TO `u3`@`localhost`
139 GRANT `r1`@`%` TO `u3`@`localhost`
140 ALTER USER u2@localhost DEFAULT ROLE r1;
141 GRANT r2 TO u3@localhost;
142 ALTER USER u3@localhost DEFAULT ROLE ALL;
143 SHOW GRANTS FOR u3@localhost;
144 Grants for u3@localhost
145 GRANT USAGE ON *.* TO `u3`@`localhost`
146 GRANT `r1`@`%`,`r2`@`%` TO `u3`@`localhost`
147 ALTER USER u3@localhost DEFAULT ROLE r2;
148 SHOW GRANTS FOR u2@localhost;
149 Grants for u2@localhost
150 GRANT USAGE ON *.* TO `u2`@`localhost`
151 GRANT `r1`@`%`,`r2`@`%` TO `u2`@`localhost`
152 SHOW GRANTS FOR u3@localhost;
153 Grants for u3@localhost
154 GRANT USAGE ON *.* TO `u3`@`localhost`
155 GRANT `r1`@`%`,`r2`@`%` TO `u3`@`localhost`
156
157 include/sync_slave_sql_with_master.inc
158 connection master;
159 connection slave;
160 connection slave;
161 SHOW GRANTS FOR u2@localhost;
162 Grants for u2@localhost
163 GRANT USAGE ON *.* TO `u2`@`localhost`
164 GRANT `r1`@`%`,`r2`@`%` TO `u2`@`localhost`
165 SHOW GRANTS FOR u3@localhost;
166 Grants for u3@localhost
167 GRANT USAGE ON *.* TO `u3`@`localhost`
168 GRANT `r1`@`%`,`r2`@`%` TO `u3`@`localhost`
169
170 SHOW CREATE USER u2@localhost;
171 CREATE USER for u2@localhost
172 CREATE USER `u2`@`localhost` IDENTIFIED WITH 'caching_sha2_password' DEFAULT ROLE `r1`@`%` REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT
173 SHOW CREATE USER u3@localhost;
174 CREATE USER for u3@localhost
175 CREATE USER `u3`@`localhost` IDENTIFIED WITH 'caching_sha2_password' DEFAULT ROLE `r2`@`%` REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK PASSWORD HISTORY DEFAULT PASSWORD REUSE INTERVAL DEFAULT PASSWORD REQUIRE CURRENT DEFAULT
176
177 # Cleanup Statement
178 [connection master]
179 DROP ROLE r1, r2, r3,r4;
180 DROP USER u1@localhost, u2@localhost, u3@localhost;
181 include/sync_slave_sql_with_master.inc
182 SELECT * FROM mysql.default_roles;
183 HOST USER DEFAULT_ROLE_HOST DEFAULT_ROLE_USER
184 SELECT * FROM mysql.role_edges;
185 FROM_HOST FROM_USER TO_HOST TO_USER WITH_ADMIN_OPTION
186 include/show_binlog_events.inc
187 Log_name Pos Event_type Server_id End_log_pos Info
188 slave-bin.000001 # Query # # use `test`; CREATE ROLE r1, r2, r3
189 slave-bin.000001 # Query # # use `test`; CREATE USER 'u1'@'localhost' IDENTIFIED WITH 'caching_sha2_password'
190 slave-bin.000001 # Query # # use `test`; GRANT r1 TO r2
191 slave-bin.000001 # Query # # use `test`; GRANT r2 TO u1@localhost
192 slave-bin.000001 # Query # # use `test`; GRANT r3 TO u1@localhost
193 slave-bin.000001 # Query # # use `test`; ALTER USER u1@localhost DEFAULT ROLE ALL
194 slave-bin.000001 # Query # # use `test`; REVOKE r3 FROM u1@localhost
195 slave-bin.000001 # Query # # use `test`; GRANT r1 TO u1@localhost
196 slave-bin.000001 # Query # # use `test`; ALTER USER u1@localhost DEFAULT ROLE r1
197 slave-bin.000001 # Query # # use `test`; ALTER USER u1@localhost DEFAULT ROLE NONE
198 slave-bin.000001 # Query # # use `test`; REVOKE r1 FROM r2
199 slave-bin.000001 # Query # # use `test`; CREATE ROLE r4
200 slave-bin.000001 # Query # # use `test`; GRANT REPLICATION SLAVE ON *.* TO 'r4'@'%'
201 slave-bin.000001 # Query # # use `test`; GRANT r4 to u1@localhost
202 slave-bin.000001 # Query # # use `test`; ALTER USER u1@localhost DEFAULT ROLE ALL
203 slave-bin.000001 # Query # # use `test`; CREATE USER 'u2'@'localhost' IDENTIFIED WITH 'caching_sha2_password' DEFAULT ROLE `r1`@`%`,`r2`@`%`
204 slave-bin.000001 # Query # # use `test`; CREATE USER 'u3'@'localhost' IDENTIFIED WITH 'caching_sha2_password' DEFAULT ROLE `r1`@`%`
205 slave-bin.000001 # Query # # use `test`; ALTER USER u2@localhost DEFAULT ROLE NONE
206 slave-bin.000001 # Query # # use `test`; ALTER USER u2@localhost DEFAULT ROLE r1
207 slave-bin.000001 # Query # # use `test`; GRANT r2 TO u3@localhost
208 slave-bin.000001 # Query # # use `test`; ALTER USER u3@localhost DEFAULT ROLE ALL
209 slave-bin.000001 # Query # # use `test`; ALTER USER u3@localhost DEFAULT ROLE r2
210 slave-bin.000001 # Query # # use `test`; DROP ROLE r1, r2, r3,r4
211 slave-bin.000001 # Query # # use `test`; DROP USER u1@localhost, u2@localhost, u3@localhost
212 include/stop_slave.inc
213 CHANGE REPLICATION SOURCE TO SOURCE_USER='root';
214 Warnings:
215 Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure.
216 Note 1760 Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
217 include/start_slave.inc
218 include/rpl_end.inc