summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-10-18 12:19:37 -0700
committerSergei Golubchik <sergii@pisem.net>2013-10-18 12:19:37 -0700
commit7dda6987341c2777acd31fd5996a325a830a462c (patch)
tree4e71300400a875bfe03fa5ce8f00d04ea4cb3e56
parentb2f16628cf4500111d59a8e52cc44851742ddfcc (diff)
downloadmariadb-git-7dda6987341c2777acd31fd5996a325a830a462c.tar.gz
rename columns in mysql.roles_mapping to be consistent with other privilege tables
-rw-r--r--mysql-test/r/acl_roles_create_and_grant_role.result6
-rw-r--r--mysql-test/r/acl_roles_rebuild_role_grants.result12
-rw-r--r--mysql-test/r/acl_roles_rename_user.result12
-rw-r--r--mysql-test/r/acl_roles_set_role-database-recursive.result22
-rw-r--r--mysql-test/r/acl_roles_set_role-database-simple.result22
-rw-r--r--mysql-test/r/acl_roles_set_role-multiple-role.result60
-rw-r--r--mysql-test/r/acl_roles_set_role-recursive.result24
-rw-r--r--mysql-test/r/acl_roles_set_role-routine-simple.result16
-rw-r--r--mysql-test/r/acl_roles_set_role-simple.result10
-rw-r--r--mysql-test/r/acl_roles_set_role-table-column-priv.result26
-rw-r--r--mysql-test/r/acl_roles_set_role-table-simple.result14
-rw-r--r--mysql-test/r/acl_roles_show_grants.result18
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result2
-rw-r--r--mysql-test/t/acl_roles_rename_user.test8
-rw-r--r--mysql-test/t/acl_roles_set_role-database-recursive.test16
-rw-r--r--mysql-test/t/acl_roles_set_role-database-simple.test18
-rw-r--r--mysql-test/t/acl_roles_set_role-multiple-role.test58
-rw-r--r--mysql-test/t/acl_roles_set_role-recursive.test16
-rw-r--r--mysql-test/t/acl_roles_set_role-routine-simple.test16
-rw-r--r--mysql-test/t/acl_roles_set_role-simple.test6
-rw-r--r--mysql-test/t/acl_roles_set_role-table-column-priv.test16
-rw-r--r--mysql-test/t/acl_roles_set_role-table-simple.test10
-rw-r--r--mysql-test/t/acl_roles_show_grants.test16
-rw-r--r--scripts/mysql_system_tables.sql2
-rw-r--r--sql/sql_acl.cc6
30 files changed, 164 insertions, 300 deletions
diff --git a/mysql-test/r/acl_roles_create_and_grant_role.result b/mysql-test/r/acl_roles_create_and_grant_role.result
index aad17ae8013..26ffbe93ef3 100644
--- a/mysql-test/r/acl_roles_create_and_grant_role.result
+++ b/mysql-test/r/acl_roles_create_and_grant_role.result
@@ -4,12 +4,12 @@ create user u1;
set role r1;
grant r1 to u1;
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
% u1 r1
localhost root r1
drop user u1;
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
localhost root r1
show grants;
Grants for root@localhost
@@ -19,7 +19,7 @@ GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
GRANT USAGE ON *.* TO 'r1'
drop role r1;
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
diff --git a/mysql-test/r/acl_roles_rebuild_role_grants.result b/mysql-test/r/acl_roles_rebuild_role_grants.result
index 4fd49b38c02..ae62eca2d92 100644
--- a/mysql-test/r/acl_roles_rebuild_role_grants.result
+++ b/mysql-test/r/acl_roles_rebuild_role_grants.result
@@ -14,7 +14,7 @@ show grants for u2;
Grants for u2@%
GRANT USAGE ON *.* TO 'u2'@'%'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
% u1 r1
revoke r1 from u1;
revoke r1 from u1;
@@ -23,7 +23,7 @@ show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
grant r1 to u1;
grant r1 to u1;
ERROR HY000: Cannot grant role 'r1' to: 'u1'.
@@ -32,23 +32,23 @@ Grants for u1@%
GRANT r1 TO 'u1'@'%'
GRANT USAGE ON *.* TO 'u1'@'%'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
% u1 r1
drop role r1;
show grants for u1;
Grants for u1@%
GRANT USAGE ON *.* TO 'u1'@'%'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
create role r1;
grant r1 to u1;
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
% u1 r1
drop user u1;
show grants for u1;
ERROR 42000: There is no such grant defined for user 'u1' on host '%'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
drop role r1;
drop user u2;
diff --git a/mysql-test/r/acl_roles_rename_user.result b/mysql-test/r/acl_roles_rename_user.result
index 2145c7e117c..2a5199667e6 100644
--- a/mysql-test/r/acl_roles_rename_user.result
+++ b/mysql-test/r/acl_roles_rename_user.result
@@ -1,16 +1,12 @@
create user test_user@localhost;
create role test_role1;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'test_role1',
-'test_role2');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
flush privileges;
use mysql;
select * from roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
rename user 'test_user'@'localhost' to 'test_user_rm'@'newhost';
@@ -20,7 +16,7 @@ test_role1
test_role2
test_user_rm newhost
select * from roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
newhost test_user_rm test_role1
delete from mysql.roles_mapping;
diff --git a/mysql-test/r/acl_roles_set_role-database-recursive.result b/mysql-test/r/acl_roles_set_role-database-recursive.result
index 04067afa253..9f3ab12a752 100644
--- a/mysql-test/r/acl_roles_set_role-database-recursive.result
+++ b/mysql-test/r/acl_roles_set_role-database-recursive.result
@@ -1,22 +1,16 @@
create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role2');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'test_role1',
-'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
select user, host from mysql.user where user not like 'root';
user host
test_role1
test_role2
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
localhost test_user test_role2
@@ -37,7 +31,7 @@ select current_user(), current_role();
current_user() current_role()
test_user@localhost test_role1
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
localhost test_user test_role2
@@ -52,7 +46,7 @@ select current_user(), current_role();
current_user() current_role()
test_user@localhost test_role2
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
localhost test_user test_role2
@@ -60,6 +54,6 @@ drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role2;
delete from mysql.user where user='test_role1';
delete from mysql.user where user='test_role2';
-delete from mysql.roles_mapping where RoleFk='test_role1';
-delete from mysql.roles_mapping where RoleFk='test_role2';
+delete from mysql.roles_mapping where Role='test_role1';
+delete from mysql.roles_mapping where Role='test_role2';
flush privileges;
diff --git a/mysql-test/r/acl_roles_set_role-database-simple.result b/mysql-test/r/acl_roles_set_role-database-simple.result
index 1cc3aba1a39..d71e7a0c099 100644
--- a/mysql-test/r/acl_roles_set_role-database-simple.result
+++ b/mysql-test/r/acl_roles_set_role-database-simple.result
@@ -1,14 +1,12 @@
create user 'test_user'@'localhost';
create role test_role1;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
select user, host from mysql.user where user not like 'root';
user host
test_role1
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
localhost test_user test_role1
flush privileges;
grant select on mysql.* to test_role1;
@@ -24,14 +22,12 @@ select current_user(), current_role();
current_user() current_role()
test_user@localhost test_role1
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
localhost test_user test_role1
insert into mysql.user (user, host) values ('Dummy', 'Dummy');
ERROR 42000: INSERT command denied to user 'test_user'@'localhost' for table 'user'
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role2');
-delete from mysql.roles_mapping where RoleFk='test_role2';
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
+delete from mysql.roles_mapping where Role='test_role2';
use mysql;
set role none;
select current_user(), current_role();
@@ -43,15 +39,13 @@ select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
insert into mysql.user (user, host) values ('Dummy', 'Dummy');
ERROR 42000: INSERT command denied to user 'test_user'@'localhost' for table 'user'
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
ERROR 42000: INSERT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
-delete from mysql.roles_mapping where RoleFk='test_role2';
+delete from mysql.roles_mapping where Role='test_role2';
ERROR 42000: DELETE command denied to user 'test_user'@'localhost' for table 'roles_mapping'
drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role1;
revoke insert, delete on mysql.roles_mapping from test_role1;
drop role test_role1;
-delete from mysql.roles_mapping where RoleFk='test_role1';
+delete from mysql.roles_mapping where Role='test_role1';
flush privileges;
diff --git a/mysql-test/r/acl_roles_set_role-multiple-role.result b/mysql-test/r/acl_roles_set_role-multiple-role.result
index 13fdf5b1f46..5af079ea611 100644
--- a/mysql-test/r/acl_roles_set_role-multiple-role.result
+++ b/mysql-test/r/acl_roles_set_role-multiple-role.result
@@ -35,27 +35,13 @@ Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv D
select * from mysql.user where user='r_rld';
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections plugin authentication_string is_role
% r_rld N N N N N N Y N N N N N N N N N N N N N N N N N N N N N N 0 0 0 0 Y
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_sel');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_ins');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_upd');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_del');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_crt');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_drp');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'r_rld');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_sel');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_ins');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_upd');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_del');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_crt');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_drp');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_rld');
flush privileges;
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
@@ -88,7 +74,7 @@ GRANT r_rld TO 'test_user'@'localhost'
GRANT r_sel TO 'test_user'@'localhost'
GRANT r_upd TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
localhost test_user r_crt
localhost test_user r_del
localhost test_user r_drp
@@ -113,9 +99,7 @@ GRANT r_sel TO 'test_user'@'localhost'
GRANT r_upd TO 'test_user'@'localhost'
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'r_sel',
-'r_rld');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_rld');
flush privileges;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
set role r_rld;
@@ -138,21 +122,11 @@ set role r_ins;
select current_user(), current_role();
current_user() current_role()
test_user@localhost r_ins
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'r_sel',
-'r_upd');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'r_sel',
-'r_del');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'r_sel',
-'r_crt');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'r_sel',
-'r_drp');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'r_del',
-'r_ins');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_upd');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_del');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_crt');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_drp');
+insert into mysql.roles_mapping values ('', 'r_del', 'r_ins');
set role r_rld;
select current_user(), current_role();
current_user() current_role()
@@ -162,7 +136,7 @@ set role r_sel;
select current_user(), current_role();
current_user() current_role()
test_user@localhost r_sel
-update mysql.roles_mapping set RoleFk='r_ins' where RoleFk='r_ins_wrong';
+update mysql.roles_mapping set Role='r_ins' where Role='r_ins_wrong';
flush privileges;
set role r_sel;
select current_user(), current_role();
@@ -173,7 +147,7 @@ insert into mysql.random_test_table values (1);
select * from mysql.random_test_table;
id
1
-delete from mysql.roles_mapping where RoleFk='r_ins';
+delete from mysql.roles_mapping where Role='r_ins';
flush privileges;
set role r_sel;
select current_user(), current_role();
@@ -183,6 +157,6 @@ insert into mysql.random_test_table values (1);
ERROR 42000: INSERT command denied to user 'test_user'@'localhost' for table 'random_test_table'
drop table mysql.random_test_table;
delete from mysql.user where user like 'r\_%';
-delete from mysql.roles_mapping where RoleFk like 'r\_%';
+delete from mysql.roles_mapping where Role like 'r\_%';
flush privileges;
drop user 'test_user'@'localhost';
diff --git a/mysql-test/r/acl_roles_set_role-recursive.result b/mysql-test/r/acl_roles_set_role-recursive.result
index 7c1f46aa1d9..a115434a673 100644
--- a/mysql-test/r/acl_roles_set_role-recursive.result
+++ b/mysql-test/r/acl_roles_set_role-recursive.result
@@ -1,25 +1,21 @@
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');
+insert into mysql.roles_mapping 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');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
flush privileges;
select user, host from mysql.user where user not like 'root';
user host
test_role1 %
test_role2 %
test_user localhost
-select * from mysql.roles_mapping where UserFk like 'test_user';
-HostFk UserFk RoleFk
+select * from mysql.roles_mapping where User like 'test_user';
+Host User Role
localhost test_user test_role1
-select * from mysql.roles_mapping where UserFk like 'test_role1';
-HostFk UserFk RoleFk
+select * from mysql.roles_mapping where User like 'test_role1';
+Host User Role
test_role1 test_role2
grant select on *.* to 'test_role2'@'';
select * from mysql.user where user like 'test_role1';
@@ -49,8 +45,8 @@ GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
GRANT test_role2 TO 'test_role1'
-select * from mysql.roles_mapping where HostFk='';
-HostFk UserFk RoleFk
+select * from mysql.roles_mapping where Host='';
+Host User Role
test_role1 test_role2
show grants;
Grants for test_user@localhost
@@ -99,8 +95,8 @@ GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
GRANT test_role2 TO 'test_role1'
-select * from mysql.roles_mapping where HostFk='';
-HostFk UserFk RoleFk
+select * from mysql.roles_mapping where Host='';
+Host User Role
test_role1 test_role2
show grants;
Grants for test_user@localhost
diff --git a/mysql-test/r/acl_roles_set_role-routine-simple.result b/mysql-test/r/acl_roles_set_role-routine-simple.result
index a57bfb9b3f2..c2fd6c32b9d 100644
--- a/mysql-test/r/acl_roles_set_role-routine-simple.result
+++ b/mysql-test/r/acl_roles_set_role-routine-simple.result
@@ -2,15 +2,9 @@ create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
create role test_role3;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role3');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'test_role1',
-'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role3');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
select user, host from mysql.user where user not like 'root';
user host
test_role1
@@ -18,7 +12,7 @@ test_role2
test_role3
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
localhost test_user test_role3
@@ -101,7 +95,7 @@ revoke execute on function mysql.test_func from test_role2;
revoke execute on procedure mysql.test_proc from test_role2;
revoke execute on mysql.* from test_role3;
delete from mysql.user where user like'test_%';
-delete from mysql.roles_mapping where RoleFk like 'test%';
+delete from mysql.roles_mapping where Role like 'test%';
drop function mysql.test_func;
drop procedure mysql.test_proc;
Warnings:
diff --git a/mysql-test/r/acl_roles_set_role-simple.result b/mysql-test/r/acl_roles_set_role-simple.result
index 7337f56e3b8..2e5f5c12ab0 100644
--- a/mysql-test/r/acl_roles_set_role-simple.result
+++ b/mysql-test/r/acl_roles_set_role-simple.result
@@ -1,15 +1,13 @@
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');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
select user, host from mysql.user where user not like 'root';
user host
test_role1 %
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
localhost test_user test_role1
grant select on *.* to 'test_role1'@'';
select * from mysql.user where user='test_role1';
@@ -35,7 +33,7 @@ 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;
-HostFk UserFk RoleFk
+Host User Role
localhost test_user test_role1
set role none;
select current_user(), current_role();
@@ -44,6 +42,6 @@ test_user@localhost NULL
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
delete from mysql.user where user='test_role1';
-delete from mysql.roles_mapping where RoleFk='test_role1';
+delete from mysql.roles_mapping where Role='test_role1';
flush privileges;
drop user 'test_user'@'localhost';
diff --git a/mysql-test/r/acl_roles_set_role-table-column-priv.result b/mysql-test/r/acl_roles_set_role-table-column-priv.result
index 5e21dab3787..72e16090e27 100644
--- a/mysql-test/r/acl_roles_set_role-table-column-priv.result
+++ b/mysql-test/r/acl_roles_set_role-table-column-priv.result
@@ -1,22 +1,18 @@
create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'test_role1',
-'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
select user, host from mysql.user where user not like 'root';
user host
test_role1
test_role2
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
-grant select (RoleFk) on mysql.roles_mapping to test_role2;
+grant select (Role) on mysql.roles_mapping to test_role2;
flush privileges;
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
@@ -33,21 +29,21 @@ current_user() current_role()
test_user@localhost test_role1
show grants;
Grants for test_user@localhost
-GRANT SELECT (RoleFk) ON `mysql`.`roles_mapping` TO 'test_role2'
+GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
GRANT test_role2 TO 'test_role1'
select * from mysql.roles_mapping;
-ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for column 'HostFk' in table 'roles_mapping'
-select RoleFk from mysql.roles_mapping;
-RoleFk
+ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for column 'Host' in table 'roles_mapping'
+select Role from mysql.roles_mapping;
+Role
test_role1
test_role2
show grants;
Grants for test_user@localhost
-GRANT SELECT (RoleFk) ON `mysql`.`roles_mapping` TO 'test_role2'
+GRANT SELECT (Role) ON `mysql`.`roles_mapping` TO 'test_role2'
GRANT USAGE ON *.* TO 'test_role1'
GRANT USAGE ON *.* TO 'test_role2'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
@@ -58,7 +54,7 @@ set role none;
select current_user(), current_role();
current_user() current_role()
test_user@localhost NULL
-select RoleFk from mysql.roles_mapping;
+select Role from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'roles_mapping'
drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
@@ -66,5 +62,5 @@ Host Db User Table_name Grantor Timestamp Table_priv Column_priv
mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
-delete from mysql.roles_mapping where RoleFk like 'test%';
+delete from mysql.roles_mapping where Role like 'test%';
flush privileges;
diff --git a/mysql-test/r/acl_roles_set_role-table-simple.result b/mysql-test/r/acl_roles_set_role-table-simple.result
index 01d84757ea4..b00f216017f 100644
--- a/mysql-test/r/acl_roles_set_role-table-simple.result
+++ b/mysql-test/r/acl_roles_set_role-table-simple.result
@@ -1,19 +1,15 @@
create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'test_role1',
-'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
select user, host from mysql.user where user not like 'root';
user host
test_role1
test_role2
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
grant select on mysql.roles_mapping to test_role2;
@@ -40,7 +36,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
GRANT test_role1 TO 'test_user'@'localhost'
GRANT test_role2 TO 'test_role1'
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
show grants;
@@ -64,5 +60,5 @@ Host Db User Table_name Grantor Timestamp Table_priv Column_priv
mysql test_role2 roles_mapping root@localhost 0000-00-00 00:00:00 Select
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
-delete from mysql.roles_mapping where RoleFk like 'test%';
+delete from mysql.roles_mapping where Role like 'test%';
flush privileges;
diff --git a/mysql-test/r/acl_roles_show_grants.result b/mysql-test/r/acl_roles_show_grants.result
index f615fba2ea4..df535b6ffe9 100644
--- a/mysql-test/r/acl_roles_show_grants.result
+++ b/mysql-test/r/acl_roles_show_grants.result
@@ -1,22 +1,16 @@
create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
-'test_user',
-'test_role2');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
-'test_role1',
-'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
select user, host from mysql.user where user not like 'root';
user host
test_role1
test_role2
test_user localhost
select * from mysql.roles_mapping;
-HostFk UserFk RoleFk
+Host User Role
test_role1 test_role2
localhost test_user test_role1
localhost test_user test_role2
@@ -145,6 +139,6 @@ drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role2;
drop role test_role1;
drop role test_role2;
-delete from mysql.roles_mapping where RoleFk='test_role1';
-delete from mysql.roles_mapping where RoleFk='test_role2';
+delete from mysql.roles_mapping where Role='test_role1';
+delete from mysql.roles_mapping where Role='test_role2';
flush privileges;
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index c7706a246a4..512e6384478 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -161,9 +161,9 @@ def mysql proxies_priv Proxied_user 4 NO char 16 48 NULL NULL NULL utf8 utf8_bi
def mysql proxies_priv Timestamp 7 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
def mysql proxies_priv User 2 NO char 16 48 NULL NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references
-def mysql roles_mapping HostFk 1 NO char 60 60 NULL NULL NULL latin1 latin1_bin char(60) PRI select,insert,update,references
-def mysql roles_mapping RoleFk 3 NO char 16 16 NULL NULL NULL latin1 latin1_bin char(16) PRI select,insert,update,references
-def mysql roles_mapping UserFk 2 NO char 16 16 NULL NULL NULL latin1 latin1_bin char(16) PRI select,insert,update,references
+def mysql roles_mapping Host 1 NO char 60 60 NULL NULL NULL latin1 latin1_bin char(60) PRI select,insert,update,references
+def mysql roles_mapping Role 3 NO char 16 16 NULL NULL NULL latin1 latin1_bin char(16) PRI select,insert,update,references
+def mysql roles_mapping User 2 NO char 16 16 NULL NULL NULL latin1 latin1_bin char(16) PRI select,insert,update,references
def mysql servers Db 3 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
def mysql servers Host 2 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
def mysql servers Owner 9 NO char 64 192 NULL NULL NULL utf8 utf8_general_ci char(64) select,insert,update,references
@@ -484,9 +484,9 @@ NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
NULL mysql proxies_priv With_grant tinyint NULL NULL NULL NULL tinyint(1)
3.0000 mysql proxies_priv Grantor char 77 231 utf8 utf8_bin char(77)
NULL mysql proxies_priv Timestamp timestamp NULL NULL NULL NULL timestamp
-1.0000 mysql roles_mapping HostFk char 60 60 latin1 latin1_bin char(60)
-1.0000 mysql roles_mapping UserFk char 16 16 latin1 latin1_bin char(16)
-1.0000 mysql roles_mapping RoleFk char 16 16 latin1 latin1_bin char(16)
+1.0000 mysql roles_mapping Host char 60 60 latin1 latin1_bin char(60)
+1.0000 mysql roles_mapping User char 16 16 latin1 latin1_bin char(16)
+1.0000 mysql roles_mapping Role char 16 16 latin1 latin1_bin char(16)
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
index 3241c807a8f..4f2ce3d2be2 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
@@ -119,9 +119,9 @@ def mysql PRIMARY def mysql proxies_priv Host
def mysql PRIMARY def mysql proxies_priv User
def mysql PRIMARY def mysql proxies_priv Proxied_host
def mysql PRIMARY def mysql proxies_priv Proxied_user
-def mysql HostFk def mysql roles_mapping HostFk
-def mysql HostFk def mysql roles_mapping UserFk
-def mysql HostFk def mysql roles_mapping RoleFk
+def mysql Host def mysql roles_mapping Host
+def mysql Host def mysql roles_mapping User
+def mysql Host def mysql roles_mapping Role
def mysql PRIMARY def mysql servers Server_name
def mysql PRIMARY def mysql table_stats db_name
def mysql PRIMARY def mysql table_stats table_name
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index 9557e9f9a1a..4a07b531b59 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -132,9 +132,9 @@ def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql PRIMARY
def mysql proxies_priv mysql Grantor
-def mysql roles_mapping mysql HostFk
-def mysql roles_mapping mysql HostFk
-def mysql roles_mapping mysql HostFk
+def mysql roles_mapping mysql Host
+def mysql roles_mapping mysql Host
+def mysql roles_mapping mysql Host
def mysql servers mysql PRIMARY
def mysql table_stats mysql PRIMARY
def mysql table_stats mysql PRIMARY
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
index c48640f17f5..bb68f5fd726 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
@@ -54,9 +54,9 @@ def mysql proxies_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 3 Proxied_host A #CARD# NULL NULL BTREE
def mysql proxies_priv 0 mysql PRIMARY 4 Proxied_user A #CARD# NULL NULL BTREE
-def mysql roles_mapping 0 mysql HostFk 1 HostFk A #CARD# NULL NULL BTREE
-def mysql roles_mapping 0 mysql HostFk 2 UserFk A #CARD# NULL NULL BTREE
-def mysql roles_mapping 0 mysql HostFk 3 RoleFk A #CARD# NULL NULL BTREE
+def mysql roles_mapping 0 mysql Host 1 Host A #CARD# NULL NULL BTREE
+def mysql roles_mapping 0 mysql Host 2 User A #CARD# NULL NULL BTREE
+def mysql roles_mapping 0 mysql Host 3 Role A #CARD# NULL NULL BTREE
def mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
def mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
def mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index 677b6857994..a3f90995aff 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -77,7 +77,7 @@ def mysql PRIMARY mysql plugin
def mysql PRIMARY mysql proc
def mysql PRIMARY mysql procs_priv
def mysql PRIMARY mysql proxies_priv
-def mysql HostFk mysql roles_mapping
+def mysql Host mysql roles_mapping
def mysql PRIMARY mysql servers
def mysql PRIMARY mysql table_stats
def mysql PRIMARY mysql tables_priv
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
index a8afcb086b1..8420d9a53c7 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
@@ -27,7 +27,7 @@ def mysql PRIMARY mysql plugin PRIMARY KEY
def mysql PRIMARY mysql proc PRIMARY KEY
def mysql PRIMARY mysql procs_priv PRIMARY KEY
def mysql PRIMARY mysql proxies_priv PRIMARY KEY
-def mysql HostFk mysql roles_mapping UNIQUE
+def mysql Host mysql roles_mapping UNIQUE
def mysql PRIMARY mysql servers PRIMARY KEY
def mysql PRIMARY mysql tables_priv PRIMARY KEY
def mysql PRIMARY mysql table_stats PRIMARY KEY
diff --git a/mysql-test/t/acl_roles_rename_user.test b/mysql-test/t/acl_roles_rename_user.test
index 37bbfaade2c..247ecf46cf2 100644
--- a/mysql-test/t/acl_roles_rename_user.test
+++ b/mysql-test/t/acl_roles_rename_user.test
@@ -2,13 +2,9 @@
#create a user with no privileges
create user test_user@localhost;
create role test_role1;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'test_role1',
- 'test_role2');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
flush privileges;
use mysql;
diff --git a/mysql-test/t/acl_roles_set_role-database-recursive.test b/mysql-test/t/acl_roles_set_role-database-recursive.test
index 3da48c56a28..8ad00652539 100644
--- a/mysql-test/t/acl_roles_set_role-database-recursive.test
+++ b/mysql-test/t/acl_roles_set_role-database-recursive.test
@@ -3,15 +3,9 @@ create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role2');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'test_role1',
- 'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
@@ -48,6 +42,6 @@ drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role2;
delete from mysql.user where user='test_role1';
delete from mysql.user where user='test_role2';
-delete from mysql.roles_mapping where RoleFk='test_role1';
-delete from mysql.roles_mapping where RoleFk='test_role2';
+delete from mysql.roles_mapping where Role='test_role1';
+delete from mysql.roles_mapping where Role='test_role2';
flush privileges;
diff --git a/mysql-test/t/acl_roles_set_role-database-simple.test b/mysql-test/t/acl_roles_set_role-database-simple.test
index 69cf1ae2009..af514c40315 100644
--- a/mysql-test/t/acl_roles_set_role-database-simple.test
+++ b/mysql-test/t/acl_roles_set_role-database-simple.test
@@ -2,9 +2,7 @@
create user 'test_user'@'localhost';
create role test_role1;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
@@ -27,10 +25,8 @@ select current_user(), current_role();
select * from mysql.roles_mapping;
--error ER_TABLEACCESS_DENIED_ERROR
insert into mysql.user (user, host) values ('Dummy', 'Dummy');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role2');
-delete from mysql.roles_mapping where RoleFk='test_role2';
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
+delete from mysql.roles_mapping where Role='test_role2';
use mysql;
@@ -44,17 +40,15 @@ select * from mysql.roles_mapping;
--error ER_TABLEACCESS_DENIED_ERROR
insert into mysql.user (user, host) values ('Dummy', 'Dummy');
--error ER_TABLEACCESS_DENIED_ERROR
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
--error ER_TABLEACCESS_DENIED_ERROR
-delete from mysql.roles_mapping where RoleFk='test_role2';
+delete from mysql.roles_mapping where Role='test_role2';
change_user 'root';
drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role1;
revoke insert, delete on mysql.roles_mapping from test_role1;
drop role test_role1;
-delete from mysql.roles_mapping where RoleFk='test_role1';
+delete from mysql.roles_mapping where Role='test_role1';
flush privileges;
diff --git a/mysql-test/t/acl_roles_set_role-multiple-role.test b/mysql-test/t/acl_roles_set_role-multiple-role.test
index ce406301f4e..22d338ca0ad 100644
--- a/mysql-test/t/acl_roles_set_role-multiple-role.test
+++ b/mysql-test/t/acl_roles_set_role-multiple-role.test
@@ -29,27 +29,13 @@ select * from mysql.user where user='r_rld';
#####################################
#set up roles mapping
#####################################
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_sel');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_ins');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_upd');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_del');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_crt');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_drp');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'r_rld');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_sel');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_ins');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_upd');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_del');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_crt');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_drp');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'r_rld');
flush privileges;
change_user 'test_user';
@@ -73,9 +59,7 @@ select current_user(), current_role();
show grants;
--error ER_TABLEACCESS_DENIED_ERROR
select * from mysql.roles_mapping;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'r_sel',
- 'r_rld');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_rld');
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
flush privileges;
set role r_rld;
@@ -91,27 +75,17 @@ flush privileges;
set role r_ins;
select current_user(), current_role();
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'r_sel',
- 'r_upd');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'r_sel',
- 'r_del');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'r_sel',
- 'r_crt');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'r_sel',
- 'r_drp');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'r_del',
- 'r_ins');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_upd');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_del');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_crt');
+insert into mysql.roles_mapping values ('', 'r_sel', 'r_drp');
+insert into mysql.roles_mapping values ('', 'r_del', 'r_ins');
set role r_rld;
select current_user(), current_role();
flush privileges;
set role r_sel;
select current_user(), current_role();
-update mysql.roles_mapping set RoleFk='r_ins' where RoleFk='r_ins_wrong';
+update mysql.roles_mapping set Role='r_ins' where Role='r_ins_wrong';
flush privileges;
set role r_sel;
select current_user(), current_role();
@@ -120,7 +94,7 @@ create table mysql.random_test_table (id INT);
insert into mysql.random_test_table values (1);
--sorted_result
select * from mysql.random_test_table;
-delete from mysql.roles_mapping where RoleFk='r_ins';
+delete from mysql.roles_mapping where Role='r_ins';
flush privileges;
set role r_sel;
select current_user(), current_role();
@@ -130,6 +104,6 @@ drop table mysql.random_test_table;
change_user 'root';
delete from mysql.user where user like 'r\_%';
-delete from mysql.roles_mapping where RoleFk like 'r\_%';
+delete from mysql.roles_mapping where Role like 'r\_%';
flush privileges;
drop user 'test_user'@'localhost';
diff --git a/mysql-test/t/acl_roles_set_role-recursive.test b/mysql-test/t/acl_roles_set_role-recursive.test
index b3d09bc8d53..77aeba4c719 100644
--- a/mysql-test/t/acl_roles_set_role-recursive.test
+++ b/mysql-test/t/acl_roles_set_role-recursive.test
@@ -4,23 +4,19 @@ 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');
+insert into mysql.roles_mapping 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');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
flush privileges;
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
-select * from mysql.roles_mapping where UserFk like 'test_user';
+select * from mysql.roles_mapping where User like 'test_user';
--sorted_result
-select * from mysql.roles_mapping where UserFk like 'test_role1';
+select * from mysql.roles_mapping where User like 'test_role1';
grant select on *.* to 'test_role2'@'';
--sorted_result
select * from mysql.user where user like 'test_role1';
@@ -40,7 +36,7 @@ set role test_role1;
select current_user(), current_role();
--sorted_result
show grants;
-select * from mysql.roles_mapping where HostFk='';
+select * from mysql.roles_mapping where Host='';
--sorted_result
show grants;
@@ -69,7 +65,7 @@ select current_user(), current_role();
--sorted_result
show grants;
--sorted_result
-select * from mysql.roles_mapping where HostFk='';
+select * from mysql.roles_mapping where Host='';
--sorted_result
show grants;
diff --git a/mysql-test/t/acl_roles_set_role-routine-simple.test b/mysql-test/t/acl_roles_set_role-routine-simple.test
index 050c7cd6ebd..a41e17bd7ef 100644
--- a/mysql-test/t/acl_roles_set_role-routine-simple.test
+++ b/mysql-test/t/acl_roles_set_role-routine-simple.test
@@ -3,16 +3,10 @@ create role test_role1;
create role test_role2;
create role test_role3;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role3');
-
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'test_role1',
- 'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role3');
+
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
@@ -82,7 +76,7 @@ revoke execute on function mysql.test_func from test_role2;
revoke execute on procedure mysql.test_proc from test_role2;
revoke execute on mysql.* from test_role3;
delete from mysql.user where user like'test_%';
-delete from mysql.roles_mapping where RoleFk like 'test%';
+delete from mysql.roles_mapping where Role like 'test%';
drop function mysql.test_func;
drop procedure mysql.test_proc;
flush privileges;
diff --git a/mysql-test/t/acl_roles_set_role-simple.test b/mysql-test/t/acl_roles_set_role-simple.test
index 210623e7d78..183bca19dae 100644
--- a/mysql-test/t/acl_roles_set_role-simple.test
+++ b/mysql-test/t/acl_roles_set_role-simple.test
@@ -4,9 +4,7 @@ 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');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
@@ -38,6 +36,6 @@ select * from mysql.roles_mapping;
change_user 'root';
delete from mysql.user where user='test_role1';
-delete from mysql.roles_mapping where RoleFk='test_role1';
+delete from mysql.roles_mapping where Role='test_role1';
flush privileges;
drop user 'test_user'@'localhost';
diff --git a/mysql-test/t/acl_roles_set_role-table-column-priv.test b/mysql-test/t/acl_roles_set_role-table-column-priv.test
index 2ebe4542243..b4d38c207be 100644
--- a/mysql-test/t/acl_roles_set_role-table-column-priv.test
+++ b/mysql-test/t/acl_roles_set_role-table-column-priv.test
@@ -2,18 +2,14 @@ create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'test_role1',
- 'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
select * from mysql.roles_mapping;
-grant select (RoleFk) on mysql.roles_mapping to test_role2;
+grant select (Role) on mysql.roles_mapping to test_role2;
flush privileges;
@@ -36,7 +32,7 @@ show grants;
select * from mysql.roles_mapping;
--sorted_result
-select RoleFk from mysql.roles_mapping;
+select Role from mysql.roles_mapping;
--sorted_result
show grants;
@@ -48,13 +44,13 @@ select current_user(), current_role();
--sorted_result
--error ER_TABLEACCESS_DENIED_ERROR
-select RoleFk from mysql.roles_mapping;
+select Role from mysql.roles_mapping;
change_user 'root';
drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
-delete from mysql.roles_mapping where RoleFk like 'test%';
+delete from mysql.roles_mapping where Role like 'test%';
flush privileges;
diff --git a/mysql-test/t/acl_roles_set_role-table-simple.test b/mysql-test/t/acl_roles_set_role-table-simple.test
index 906f9f99ff6..4b4f12e0cf9 100644
--- a/mysql-test/t/acl_roles_set_role-table-simple.test
+++ b/mysql-test/t/acl_roles_set_role-table-simple.test
@@ -2,12 +2,8 @@ create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'test_role1',
- 'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
@@ -52,6 +48,6 @@ drop user 'test_user'@'localhost';
select * from mysql.tables_priv;
revoke select on mysql.roles_mapping from test_role2;
delete from mysql.user where user like'test_%';
-delete from mysql.roles_mapping where RoleFk like 'test%';
+delete from mysql.roles_mapping where Role like 'test%';
flush privileges;
diff --git a/mysql-test/t/acl_roles_show_grants.test b/mysql-test/t/acl_roles_show_grants.test
index 7fb36f8c12d..5cc22633b8e 100644
--- a/mysql-test/t/acl_roles_show_grants.test
+++ b/mysql-test/t/acl_roles_show_grants.test
@@ -3,15 +3,9 @@ create user 'test_user'@'localhost';
create role test_role1;
create role test_role2;
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role1');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
- 'test_user',
- 'test_role2');
-insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
- 'test_role1',
- 'test_role2');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role1');
+insert into mysql.roles_mapping values ('localhost', 'test_user', 'test_role2');
+insert into mysql.roles_mapping values ('', 'test_role1', 'test_role2');
--sorted_result
select user, host from mysql.user where user not like 'root';
--sorted_result
@@ -90,6 +84,6 @@ drop user 'test_user'@'localhost';
revoke select on mysql.* from test_role2;
drop role test_role1;
drop role test_role2;
-delete from mysql.roles_mapping where RoleFk='test_role1';
-delete from mysql.roles_mapping where RoleFk='test_role2';
+delete from mysql.roles_mapping where Role='test_role1';
+delete from mysql.roles_mapping where Role='test_role2';
flush privileges;
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index 7f85cb409f3..b6187ee3911 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -41,7 +41,7 @@ CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, Us
-- Remember for later if user table already existed
set @had_user_table= @@warning_count != 0;
-CREATE TABLE IF NOT EXISTS roles_mapping (HostFk char(60) binary DEFAULT '' NOT NULL, UserFk char(16) binary DEFAULT '' NOT NULL, RoleFk char(16) binary DEFAULT '' NOT NULL, unique index (HostFk, UserFk, RoleFk));
+CREATE TABLE IF NOT EXISTS roles_mapping (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Role char(16) binary DEFAULT '' NOT NULL, unique index (Host, User, Role));
CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions';
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index eea2169f7d1..1824632eaae 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -8072,10 +8072,10 @@ static int handle_roles_mappings_table(TABLE *table, bool drop,
LEX_USER *user_from, LEX_USER *user_to)
{
/*
- All entries (HostFK, UserFk) that match user_from will be renamed,
- as well as all RoleFk entries that match if user_from.host.str == ""
+ All entries (Host, User) that match user_from will be renamed,
+ as well as all Role entries that match if user_from.host.str == ""
- Otherwise, only matching (HostFk, UserFk) will be renamed.
+ Otherwise, only matching (Host, User) will be renamed.
*/
DBUG_ENTER("handle_roles_mappings_table");