mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 01:04:19 +01:00
48 lines
1.3 KiB
Text
48 lines
1.3 KiB
Text
|
source include/not_embedded.inc;
|
||
|
|
||
|
create user test_user@localhost;
|
||
|
create role test_role;
|
||
|
grant select on *.* to test_role;
|
||
|
grant test_role to test_user@localhost;
|
||
|
|
||
|
--connect (c1, localhost, test_user,,)
|
||
|
show grants;
|
||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
set default role test_role;
|
||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
disconnect c1;
|
||
|
|
||
|
connection default;
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
|
||
|
|
||
|
--connect (c1, localhost, test_user,,)
|
||
|
show grants;
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
set default role NONE;
|
||
|
disconnect c1;
|
||
|
|
||
|
connection default;
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
|
||
|
--connect (c1, localhost, test_user,,)
|
||
|
show grants;
|
||
|
--error ER_TABLEACCESS_DENIED_ERROR
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
disconnect c1;
|
||
|
|
||
|
connection default;
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
set default role test_role for test_user@localhost;
|
||
|
|
||
|
--connect (c1, localhost, test_user,,)
|
||
|
show grants;
|
||
|
select user, host, default_role from mysql.user where user = 'test_user';
|
||
|
disconnect c1;
|
||
|
|
||
|
connection default;
|
||
|
drop role test_role;
|
||
|
drop user test_user@localhost;
|