mariadb/mysql-test/r/acl_roles_rename_user.result

51 lines
1.4 KiB
Text
Raw Normal View History

create user 'test_user'@'localhost';
create user 'test_role1'@'';
update mysql.user set is_role='Y' where user='test_role1';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
'test_user',
'test_role1');
create user 'test_role2'@'';
update mysql.user set is_role='Y' where user='test_role2';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
'test_role1',
'test_role2');
flush privileges;
use mysql;
select * from roles_mapping;
HostFk UserFk RoleFk
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
test_role1
test_role2
test_user_rm newhost
select * from roles_mapping;
HostFk UserFk RoleFk
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
test_role1
test_role2_rm
test_user_rm newhost
select * from roles_mapping;
HostFk UserFk RoleFk
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
test_role1_rm
test_role2_rm
test_user_rm newhost
select * from roles_mapping;
HostFk UserFk RoleFk
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;