summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/rpl/t/rpl_create_drop_role.test
blob: 7260b473530991173836207bb1fb7d21db029d6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
--source include/master-slave.inc

connection master;
CREATE ROLE role_1;
sync_slave_with_master;

SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;

connection master;
CREATE ROLE IF NOT EXISTS role_1;
CREATE ROLE IF NOT EXISTS role_2;
sync_slave_with_master;

SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;

connection master;

--error ER_WRONG_USAGE
CREATE OR REPLACE ROLE IF NOT EXISTS role_3; 

CREATE OR REPLACE ROLE role_3; 
CREATE OR REPLACE ROLE role_2; 
sync_slave_with_master;

SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;

connection master;
--error ER_CANNOT_USER
CREATE ROLE role_2;

sync_slave_with_master;

SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;

connection master;
DROP ROLE role_1;
DROP ROLE IF EXISTS role_2;
DROP ROLE IF EXISTS role_3;
DROP ROLE IF EXISTS role_4;

--error ER_CANNOT_USER
DROP ROLE role_4;

sync_slave_with_master;

SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;

--source include/rpl_end.inc