Commit 80491609 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-17946 : Unsorted acl_dbs after RENAME USER

parent 34eb9838
...@@ -2770,3 +2770,12 @@ CREATE USER bar2@localhost; ...@@ -2770,3 +2770,12 @@ CREATE USER bar2@localhost;
RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost; RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost;
DROP USER bar2@localhost; DROP USER bar2@localhost;
DROP USER bar3@localhost; DROP USER bar3@localhost;
#
# MDEV-17946 : Unsorted acl_dbs after RENAME USER
#
CREATE USER foo;
GRANT SELECT ON test.* TO foo;
RENAME USER '' TO 'name';
GRANT UPDATE ON test.* TO foo;
RENAME USER 'name' to '';
DROP USER foo;
...@@ -2267,3 +2267,14 @@ CREATE USER bar2@localhost; ...@@ -2267,3 +2267,14 @@ CREATE USER bar2@localhost;
RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost; RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost;
DROP USER bar2@localhost; DROP USER bar2@localhost;
DROP USER bar3@localhost; DROP USER bar3@localhost;
--echo #
--echo # MDEV-17946 : Unsorted acl_dbs after RENAME USER
--echo #
CREATE USER foo;
GRANT SELECT ON test.* TO foo;
RENAME USER '' TO 'name';
GRANT UPDATE ON test.* TO foo;
RENAME USER 'name' to '';
DROP USER foo;
...@@ -10368,6 +10368,8 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) ...@@ -10368,6 +10368,8 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
rebuild_acl_users(); rebuild_acl_users();
} }
/* Rebuild 'acl_dbs' since 'acl_users' has been modified */
rebuild_acl_dbs();
/* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */
rebuild_check_host(); rebuild_check_host();
......
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