Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a0a8f508
Commit
a0a8f508
authored
Oct 17, 2013
by
Vicențiu Ciorbaru
Committed by
Sergei Golubchik
Oct 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for acl_roles to test renaming of roles/ usernames
parent
9fa7f1fc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
87 additions
and
0 deletions
+87
-0
mysql-test/r/acl_roles_rename_user.result
mysql-test/r/acl_roles_rename_user.result
+50
-0
mysql-test/t/acl_roles_rename_user.test
mysql-test/t/acl_roles_rename_user.test
+37
-0
No files found.
mysql-test/r/acl_roles_rename_user.result
0 → 100644
View file @
a0a8f508
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
localhost test_user test_role1
test_role1 test_role2
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
newhost test_user_rm test_role1
test_role1 test_role2
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
newhost test_user_rm test_role1
test_role1 test_role2_rm
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
newhost test_user_rm test_role1_rm
test_role1_rm test_role2_rm
delete from mysql.roles_mapping;
delete from mysql.user where user like 'test%';
flush privileges;
mysql-test/t/acl_roles_rename_user.test
0 → 100644
View file @
a0a8f508
#create a user with no privileges
create
user
'test_user'
@
'localhost'
;
create
user
'test_role1'
@
''
;
#manualy create role
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'
@
''
;
#manualy create role
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
;
#regular user rename
rename
user
'test_user'
@
'localhost'
to
'test_user_rm'
@
'newhost'
;
select
user
,
host
from
user
where
user
like
'test%'
;
select
*
from
roles_mapping
;
rename
user
'test_role2'
@
''
to
'test_role2_rm'
@
''
;
select
user
,
host
from
user
where
user
like
'test%'
;
select
*
from
roles_mapping
;
#role rename
rename
user
'test_role1'
@
''
to
'test_role1_rm'
@
''
;
select
user
,
host
from
user
where
user
like
'test%'
;
select
*
from
roles_mapping
;
delete
from
mysql
.
roles_mapping
;
delete
from
mysql
.
user
where
user
like
'test%'
;
flush
privileges
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment