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';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
'test_role1',
'test_role2');
select user, host from mysql.user;
flush privileges;
select user, host from mysql.user where user not like 'root';
user host
test_role1
test_role2
root 127.0.0.1
root ::1
root Arrakis
root localhost
test_user localhost
select * from mysql.roles_mapping;
HostFk UserFk RoleFk
......@@ -81,8 +78,7 @@ GRANT USAGE ON *.* TO 'test_user'@'localhost'
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 UserFk like 'test_role1';
delete from mysql.user where user='test_role2';
delete from mysql.roles_mapping where UserFk like 'test_role2';
drop user 'test_user'@'localhost';
delete from mysql.roles_mapping;
flush privileges;
drop user 'test_user'@'localhost';
......@@ -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',
'test_user',
'test_role1');
select user, host from mysql.user;
select user, host from mysql.user where user not like 'root';
user host
test_role1
root 127.0.0.1
root ::1
root Arrakis
root localhost
test_user localhost
select * from mysql.roles_mapping;
HostFk UserFk RoleFk
......
......@@ -13,7 +13,9 @@ update mysql.user set is_role='Y' where user='test_role2';
insert into mysql.roles_mapping (HostFk, UserFk, RoleFk) values ('',
'test_role1',
'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;
grant select on *.* to 'test_role2'@'';
select * from mysql.user where user like 'test_role%';
......@@ -56,8 +58,7 @@ select * from mysql.roles_mapping;
change_user 'root';
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.roles_mapping where UserFk like 'test_role2';
drop user 'test_user'@'localhost';
delete from mysql.roles_mapping;
flush privileges;
drop user 'test_user'@'localhost';
......@@ -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',
'test_user',
'test_role1');
select user, host from mysql.user;
select user, host from mysql.user where user not like 'root';
select * from mysql.roles_mapping;
grant select on *.* to '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,
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)))
{
*length=(uint) entry->user.length;
......@@ -2377,9 +2377,9 @@ int add_role_user_mapping(ROLE_GRANT_PAIR *mapping)
}
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->r_uname));
mapping->r_uname, user, role));
return -1;
}
......@@ -2725,6 +2725,7 @@ find_acl_role(const char *user)
{
DBUG_ENTER("find_acl_role");
DBUG_PRINT("enter",("user: '%s'", user));
DBUG_PRINT("info", ("Hash elements: %ld", acl_roles.records));
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