Skip to content

Commit

Permalink
MDEV-22521 Server crashes in traverse_role_graph_up or Assertion `use…
Browse files Browse the repository at this point in the history
…r' fails in traverse_role_graph_impl
  • Loading branch information
vuvova committed Jul 30, 2020
1 parent 4860fe2 commit 4635218
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mysql-test/suite/roles/drop_current_role.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
create role r;
set role r;
drop role r;
revoke all on *.* from current_role;
ERROR 42000: There is no such grant defined for user 'r' on host ''
9 changes: 9 additions & 0 deletions mysql-test/suite/roles/drop_current_role.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--source include/not_embedded.inc
#
# MDEV-22521 Server crashes in traverse_role_graph_up or Assertion `user' fails in traverse_role_graph_impl
#
create role r;
set role r;
drop role r;
error ER_NONEXISTING_GRANT;
revoke all on *.* from current_role;
2 changes: 2 additions & 0 deletions sql/sql_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4977,6 +4977,8 @@ static void propagate_role_grants(ACL_ROLE *role,
enum PRIVS_TO_MERGE::what what,
const char *db= 0, const char *name= 0)
{
if (!role)
return;

mysql_mutex_assert_owner(&acl_cache->lock);
PRIVS_TO_MERGE data= { what, db, name };
Expand Down

0 comments on commit 4635218

Please sign in to comment.