Debian Codegraph @

mysql-test/suite/roles/grant-5771.test

raw
1 #
2 # MDEV-5771 Privileges acquired via roles depend on the order of granting
3 #
4 --source include/not_embedded.inc
5
6 create database mysqltest1;
7 create database mysqltest2;
8
9 create user foo@localhost;
10 create role r1, r2;
11 grant all on mysqltest1.* to r1;
12 grant all on mysqltest2.* to r2;
13 grant r1 to r2;
14 grant r2 to foo@localhost;
15
16 --connect (foo,localhost,foo,,)
17 select current_user;
18 --error ER_DBACCESS_DENIED_ERROR
19 show tables in mysqltest1;
20 --error ER_DBACCESS_DENIED_ERROR
21 show tables in mysqltest2;
22 set role r2;
23 show tables in mysqltest1;
24 show tables in mysqltest2;
25 show grants;
26
27 connection default;
28 drop user foo@localhost;
29 drop role r1;
30 drop role r2;
31 drop database mysqltest1;
32 drop database mysqltest2;