diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-03-13 20:12:22 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2015-05-03 11:49:49 +0300 |
commit | 6c55e52b108d43dead9aef82e791f3de7a2dd93f (patch) | |
tree | 15745e376fc6b548631ff2d4c5cc98ca008829cb /mysql-test/suite/roles | |
parent | acab0faa146993334e20d86bf685f4e32c588eb3 (diff) | |
download | mariadb-git-6c55e52b108d43dead9aef82e791f3de7a2dd93f.tar.gz |
MDEV-7774: Crash when dropping user within rebuild_role_grants
The issue comes from not taking all possibilities to match an entry
within the roles_mapping HASH, when updating the data structure.
Diffstat (limited to 'mysql-test/suite/roles')
-rw-r--r-- | mysql-test/suite/roles/create_and_drop_role.result | 18 | ||||
-rw-r--r-- | mysql-test/suite/roles/create_and_drop_role.test | 19 |
2 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result index 2974dd20e22..79c6f412111 100644 --- a/mysql-test/suite/roles/create_and_drop_role.result +++ b/mysql-test/suite/roles/create_and_drop_role.result @@ -46,3 +46,21 @@ Note 1449 The user specified as a definer ('u1'@'%') does not exist create user foo@bar; drop user foo@bar; drop role r1; +CREATE USER u1; +CREATE ROLE r1; +CREATE USER r1@localhost; +CREATE ROLE r2; +GRANT r2 to r1; +GRANT r2 to r1@localhost; +DROP ROLE r1; +SELECT * FROM mysql.roles_mapping; +Host User Role Admin_option +localhost r1 r2 N +localhost root r2 Y +SHOW GRANTS FOR r1@localhost; +Grants for r1@localhost +GRANT r2 TO 'r1'@'localhost' +GRANT USAGE ON *.* TO 'r1'@'localhost' +DROP USER u1; +DROP ROLE r2; +DROP USER r1@localhost; diff --git a/mysql-test/suite/roles/create_and_drop_role.test b/mysql-test/suite/roles/create_and_drop_role.test index 38f040789e0..0bf5b744e6b 100644 --- a/mysql-test/suite/roles/create_and_drop_role.test +++ b/mysql-test/suite/roles/create_and_drop_role.test @@ -68,3 +68,22 @@ create user foo@bar; drop user foo@bar; drop role r1; +# +# MDEV-7774 Assertion `status == 0' fails when dropping in this order: +# +CREATE USER u1; +CREATE ROLE r1; +CREATE USER r1@localhost; +CREATE ROLE r2; +GRANT r2 to r1; +GRANT r2 to r1@localhost; +# MDEV-7774: Dropping in this order caused the crash. +DROP ROLE r1; +--sorted_result +SELECT * FROM mysql.roles_mapping; +SHOW GRANTS FOR r1@localhost; # Related to MDEV-7774, also caused a crash, by + # not updating the internal acl_roles_mapping + # data structure correctly; +DROP USER u1; +DROP ROLE r2; +DROP USER r1@localhost; |