mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
MDEV-8614 Assertion `status == 0' failed in add_role_user_mapping_action on RENAME USER
don't forget to re-examine the current element when updating a HASH
This commit is contained in:
parent
956e92d908
commit
6f0754789c
3 changed files with 21 additions and 2 deletions
|
@ -56,3 +56,9 @@ Host User Role Admin_option
|
||||||
localhost root r1 Y
|
localhost root r1 Y
|
||||||
drop role r1;
|
drop role r1;
|
||||||
drop user u2;
|
drop user u2;
|
||||||
|
create user foo@localhost;
|
||||||
|
grant create user on *.* to foo@localhost;
|
||||||
|
create role look, isp, xxx, ppp;
|
||||||
|
rename user current_user to nnnn@'%';
|
||||||
|
drop role look, isp, xxx, ppp;
|
||||||
|
drop user nnnn@'%';
|
||||||
|
|
|
@ -54,3 +54,16 @@ select * from mysql.roles_mapping;
|
||||||
|
|
||||||
drop role r1;
|
drop role r1;
|
||||||
drop user u2;
|
drop user u2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-8614 Assertion `status == 0' failed in add_role_user_mapping_action on RENAME USER
|
||||||
|
#
|
||||||
|
create user foo@localhost;
|
||||||
|
grant create user on *.* to foo@localhost;
|
||||||
|
--connect (con1, localhost, foo,,)
|
||||||
|
create role look, isp, xxx, ppp;
|
||||||
|
rename user current_user to nnnn@'%';
|
||||||
|
drop role look, isp, xxx, ppp;
|
||||||
|
connection default;
|
||||||
|
disconnect con1;
|
||||||
|
drop user nnnn@'%';
|
||||||
|
|
|
@ -8977,8 +8977,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
|
||||||
So we need to examine the current element once again, but
|
So we need to examine the current element once again, but
|
||||||
we don't need to restart the search from the beginning.
|
we don't need to restart the search from the beginning.
|
||||||
*/
|
*/
|
||||||
if (idx != elements)
|
idx++;
|
||||||
idx++;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9010,6 +9009,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
|
||||||
|
|
||||||
my_hash_update(roles_mappings_hash, (uchar*) role_grant_pair,
|
my_hash_update(roles_mappings_hash, (uchar*) role_grant_pair,
|
||||||
(uchar*) old_key, old_key_length);
|
(uchar*) old_key, old_key_length);
|
||||||
|
idx++; // see the comment above
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue