Commit 68214d21 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru Committed by Sergei Golubchik

Fixed failing tests due to wrong delete in the testsuite.

parent 540673f0
...@@ -9,14 +9,11 @@ update mysql.user set is_role='Y' where user='test_role2'; ...@@ -9,14 +9,11 @@ update mysql.user set is_role='Y' where user='test_role2';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('', insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
'test_role1', 'test_role1',
'test_role2'); 'test_role2');
select user, host from mysql.user; flush privileges;
select user, host from mysql.user where user not like 'root';
user host user host
test_role1 test_role1
test_role2 test_role2
root 127.0.0.1
root ::1
root Arrakis
root localhost
test_user localhost test_user localhost
select * from mysql.roles_mapping; select * from mysql.roles_mapping;
HostFk UserFk RoleFk HostFk UserFk RoleFk
...@@ -81,8 +78,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost' ...@@ -81,8 +78,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
select * from mysql.roles_mapping; select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table '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.user where user='test_role1';
delete from mysql.roles_mapping where UserFk like 'test_role1';
delete from mysql.user where user='test_role2'; delete from mysql.user where user='test_role2';
delete from mysql.roles_mapping where UserFk like 'test_role2'; delete from mysql.roles_mapping;
drop user 'test_user'@'localhost';
flush privileges; flush privileges;
drop user 'test_user'@'localhost';
...@@ -4,13 +4,9 @@ update mysql.user set is_role='Y' where user='test_role1'; ...@@ -4,13 +4,9 @@ update mysql.user set is_role='Y' where user='test_role1';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost', insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
'test_user', 'test_user',
'test_role1'); 'test_role1');
select user, host from mysql.user; select user, host from mysql.user where user not like 'root';
user host user host
test_role1 test_role1
root 127.0.0.1
root ::1
root Arrakis
root localhost
test_user localhost test_user localhost
select * from mysql.roles_mapping; select * from mysql.roles_mapping;
HostFk UserFk RoleFk HostFk UserFk RoleFk
......
...@@ -13,7 +13,9 @@ update mysql.user set is_role='Y' where user='test_role2'; ...@@ -13,7 +13,9 @@ update mysql.user set is_role='Y' where user='test_role2';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('', insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
'test_role1', 'test_role1',
'test_role2'); 'test_role2');
select user, host from mysql.user; flush privileges;
select user, host from mysql.user where user not like 'root';
select * from mysql.roles_mapping; select * from mysql.roles_mapping;
grant select on *.* to 'test_role2'@''; grant select on *.* to 'test_role2'@'';
select * from mysql.user where user like 'test_role%'; select * from mysql.user where user like 'test_role%';
...@@ -56,8 +58,7 @@ select * from mysql.roles_mapping; ...@@ -56,8 +58,7 @@ select * from mysql.roles_mapping;
change_user 'root'; change_user 'root';
delete from mysql.user where user='test_role1'; delete from mysql.user where user='test_role1';
delete from mysql.roles_mapping where UserFk like 'test_role1';
delete from mysql.user where user='test_role2'; delete from mysql.user where user='test_role2';
delete from mysql.roles_mapping where UserFk like 'test_role2'; delete from mysql.roles_mapping;
drop user 'test_user'@'localhost';
flush privileges; flush privileges;
drop user 'test_user'@'localhost';
...@@ -7,7 +7,7 @@ update mysql.user set is_role='Y' where user='test_role1'; ...@@ -7,7 +7,7 @@ update mysql.user set is_role='Y' where user='test_role1';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost', insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('localhost',
'test_user', 'test_user',
'test_role1'); 'test_role1');
select user, host from mysql.user; select user, host from mysql.user where user not like 'root';
select * from mysql.roles_mapping; select * from mysql.roles_mapping;
grant select on *.* to 'test_role1'@''; grant select on *.* to 'test_role1'@'';
select * from mysql.user where user='test_role1'; select * from mysql.user where user='test_role1';
......
...@@ -543,7 +543,7 @@ static uchar* acl_entry_get_key(acl_entry *entry, size_t *length, ...@@ -543,7 +543,7 @@ static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
return (uchar*) entry->key; return (uchar*) entry->key;
} }
static uchar* acl_role_get_key(ACL_USER *entry, size_t *length, static uchar* acl_role_get_key(ACL_ROLE *entry, size_t *length,
my_bool not_used __attribute__((unused))) my_bool not_used __attribute__((unused)))
{ {
*length=(uint) entry->user.length; *length=(uint) entry->user.length;
...@@ -2377,9 +2377,9 @@ int add_role_user_mapping(ROLE_GRANT_PAIR *mapping) ...@@ -2377,9 +2377,9 @@ int add_role_user_mapping(ROLE_GRANT_PAIR *mapping)
} }
else else
{ {
DBUG_PRINT("warning", ("Invalid add_role_user_mapping '%s'@'%s' %s", DBUG_PRINT("warning", ("Invalid add_role_user_mapping '%s'@'%s' %s %p %p",
mapping->u_uname, mapping->u_hname, mapping->u_uname, mapping->u_hname,
mapping->r_uname)); mapping->r_uname, user, role));
return -1; return -1;
} }
...@@ -2725,6 +2725,7 @@ find_acl_role(const char *user) ...@@ -2725,6 +2725,7 @@ find_acl_role(const char *user)
{ {
DBUG_ENTER("find_acl_role"); DBUG_ENTER("find_acl_role");
DBUG_PRINT("enter",("user: '%s'", user)); DBUG_PRINT("enter",("user: '%s'", user));
DBUG_PRINT("info", ("Hash elements: %ld", acl_roles.records));
mysql_mutex_assert_owner(&acl_cache->lock); mysql_mutex_assert_owner(&acl_cache->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment