1--source include/master-slave.inc 2 3create user u1; 4create role r1; 5--echo # 6--echo # On master SHOW GRANTS work both for the user and the role: 7show grants for u1; 8show 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 16select user, host, is_role from mysql.user where user in ('u1', 'r1'); 17select * from information_schema.applicable_roles; 18--echo # 19--echo # Check show grants for the new user. 20show grants for u1; 21--echo # 22--echo # Check show grants for the new role. 23show grants for r1; 24--echo # 25--echo # Check if flushing privileges preserves the state. 26flush privileges; 27show grants for r1; 28--echo # 29--echo # Check SHOW GRANTS after setting the role. 30set role r1; 31show grants; 32show grants for r1; 33 34connection master; 35drop role r1; 36drop user u1; 37--sync_slave_with_master 38--source include/rpl_end.inc 39