mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Various bug fixes.
Also updated tests to reflect new show grants functionality.
This commit is contained in:
committed by
Sergei Golubchik
parent
8c7ca88a6c
commit
d24ead2c6f
@ -13,8 +13,8 @@ flush privileges;
|
||||
use mysql;
|
||||
select * from roles_mapping;
|
||||
HostFk UserFk RoleFk
|
||||
localhost test_user test_role1
|
||||
test_role1 test_role2
|
||||
localhost test_user test_role1
|
||||
rename user 'test_user'@'localhost' to 'test_user_rm'@'newhost';
|
||||
select user, host from user where user like 'test%';
|
||||
user host
|
||||
@ -23,8 +23,8 @@ test_role2
|
||||
test_user_rm newhost
|
||||
select * from roles_mapping;
|
||||
HostFk UserFk RoleFk
|
||||
newhost test_user_rm test_role1
|
||||
test_role1 test_role2
|
||||
newhost test_user_rm test_role1
|
||||
rename user 'test_role2'@'' to 'test_role2_rm'@'';
|
||||
select user, host from user where user like 'test%';
|
||||
user host
|
||||
@ -33,8 +33,8 @@ test_role2_rm
|
||||
test_user_rm newhost
|
||||
select * from roles_mapping;
|
||||
HostFk UserFk RoleFk
|
||||
newhost test_user_rm test_role1
|
||||
test_role1 test_role2_rm
|
||||
newhost test_user_rm test_role1
|
||||
rename user 'test_role1'@'' to 'test_role1_rm'@'';
|
||||
select user, host from user where user like 'test%';
|
||||
user host
|
||||
@ -43,8 +43,8 @@ test_role2_rm
|
||||
test_user_rm newhost
|
||||
select * from roles_mapping;
|
||||
HostFk UserFk RoleFk
|
||||
newhost test_user_rm test_role1_rm
|
||||
test_role1_rm test_role2_rm
|
||||
newhost test_user_rm test_role1_rm
|
||||
delete from mysql.roles_mapping;
|
||||
delete from mysql.user where user like 'test%';
|
||||
flush privileges;
|
||||
|
@ -72,6 +72,7 @@ GRANT r_upd TO 'test_user'@'localhost'
|
||||
set role r_sel;
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT SELECT ON *.* TO 'r_sel'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT r_crt TO 'test_user'@'localhost'
|
||||
GRANT r_del TO 'test_user'@'localhost'
|
||||
@ -92,6 +93,7 @@ localhost test_user r_upd
|
||||
set role r_ins;
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT INSERT ON *.* TO 'r_ins'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT r_crt TO 'test_user'@'localhost'
|
||||
GRANT r_del TO 'test_user'@'localhost'
|
||||
|
@ -38,6 +38,8 @@ GRANT test_role1 TO 'test_user'@'localhost'
|
||||
set role test_role1;
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT SELECT ON *.* TO 'test_role2'
|
||||
GRANT USAGE ON *.* TO 'test_role1'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT test_role1 TO 'test_user'@'localhost'
|
||||
select * from mysql.roles_mapping where HostFk='';
|
||||
@ -45,6 +47,8 @@ HostFk UserFk RoleFk
|
||||
test_role1 test_role2
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT SELECT ON *.* TO 'test_role2'
|
||||
GRANT USAGE ON *.* TO 'test_role1'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT test_role1 TO 'test_user'@'localhost'
|
||||
set role none;
|
||||
@ -73,6 +77,8 @@ GRANT test_role1 TO 'test_user'@'localhost'
|
||||
set role test_role1;
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT SELECT ON *.* TO 'test_role2'
|
||||
GRANT USAGE ON *.* TO 'test_role1'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT test_role1 TO 'test_user'@'localhost'
|
||||
select * from mysql.roles_mapping where HostFk='';
|
||||
@ -80,6 +86,8 @@ HostFk UserFk RoleFk
|
||||
test_role1 test_role2
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT SELECT ON *.* TO 'test_role2'
|
||||
GRANT USAGE ON *.* TO 'test_role1'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT test_role1 TO 'test_user'@'localhost'
|
||||
set role none;
|
||||
|
@ -25,6 +25,7 @@ GRANT test_role1 TO 'test_user'@'localhost'
|
||||
set role test_role1;
|
||||
show grants;
|
||||
Grants for test_user@localhost
|
||||
GRANT SELECT ON *.* TO 'test_role1'
|
||||
GRANT USAGE ON *.* TO 'test_user'@'localhost'
|
||||
GRANT test_role1 TO 'test_user'@'localhost'
|
||||
select * from mysql.roles_mapping;
|
||||
|
@ -16,20 +16,27 @@ insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
|
||||
flush privileges;
|
||||
|
||||
use mysql;
|
||||
--sorted_result
|
||||
select * from roles_mapping;
|
||||
|
||||
#regular user rename
|
||||
rename user 'test_user'@'localhost' to 'test_user_rm'@'newhost';
|
||||
--sorted_result
|
||||
select user, host from user where user like 'test%';
|
||||
--sorted_result
|
||||
select * from roles_mapping;
|
||||
|
||||
rename user 'test_role2'@'' to 'test_role2_rm'@'';
|
||||
--sorted_result
|
||||
select user, host from user where user like 'test%';
|
||||
--sorted_result
|
||||
select * from roles_mapping;
|
||||
|
||||
#role rename
|
||||
rename user 'test_role1'@'' to 'test_role1_rm'@'';
|
||||
--sorted_result
|
||||
select user, host from user where user like 'test%';
|
||||
--sorted_result
|
||||
select * from roles_mapping;
|
||||
|
||||
delete from mysql.roles_mapping;
|
||||
|
Reference in New Issue
Block a user