|
The following test case shows that grant order matters (when it shouldn't!) with regards to roles.
The issue is reproducible in 10.3 and onwards.
create role r1, r2;
|
create user foo;
|
|
create database some_db;
|
create table some_db.t1 (a int, b int, secret int);
|
|
grant r2 to r1;
|
grant r1 to foo;
|
|
grant select on *.* to r2;
|
grant insert on *.* to r1;
|
# flush privileges; # Adding flush privileges causes the second select to work as expected.
|
|
--connect (con1, localhost, foo,,)
|
--error ER_TABLEACCESS_DENIED_ERROR
|
select * from some_db.t1;
|
set role r1;
|
# This command should receive the select rights from r2 and thus be allowed
|
select * from some_db.t1;
|
disconnect con1;
|
|
connection default;
|
drop database some_db;
|
|
drop role r1, r2;
|
drop user foo;
|
|