Debian Codegraph @

mysql-test/suite/roles/show_grants_replicated.test

raw
1 --source include/master-slave.inc
2
3 create user u1;
4 create role r1;
5 --echo #
6 --echo # On master SHOW GRANTS work both for the user and the role:
7 show grants for u1;
8 show grants for r1;
9 --echo #
10 --sync_slave_with_master
11 --echo #
12 --echo # The role has been replicated,
13 --echo # it's visible in mysql.user and I_S:
14 --echo #
15 --sorted_result
16 select user, host, is_role from mysql.user where user in ('u1', 'r1');
17 select * from information_schema.applicable_roles;
18 --echo #
19 --echo # Check show grants for the new user.
20 show grants for u1;
21 --echo #
22 --echo # Check show grants for the new role.
23 show grants for r1;
24 --echo #
25 --echo # Check if flushing privileges preserves the state.
26 flush privileges;
27 show grants for r1;
28 --echo #
29 --echo # Check SHOW GRANTS after setting the role.
30 set role r1;
31 show grants;
32 show grants for r1;
33
34 connection master;
35 drop role r1;
36 drop user u1;
37 --sync_slave_with_master
38 --source include/rpl_end.inc