diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result index 74f86edd4ea..2b92a2bd797 100644 --- a/mysql-test/main/grant.result +++ b/mysql-test/main/grant.result @@ -2762,3 +2762,11 @@ DROP USER dummy@localhost; # # End of 10.2 tests # +# +# MDEV-17932 : Assertion upon double RENAME USER +# +CREATE USER foo@localhost; +CREATE USER bar2@localhost; +RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost; +DROP USER bar2@localhost; +DROP USER bar3@localhost; diff --git a/mysql-test/main/grant.test b/mysql-test/main/grant.test index f54c4bd981d..10da0af4ea5 100644 --- a/mysql-test/main/grant.test +++ b/mysql-test/main/grant.test @@ -2258,3 +2258,12 @@ DROP USER dummy@localhost; --echo # --echo # End of 10.2 tests --echo # + +--echo # +--echo # MDEV-17932 : Assertion upon double RENAME USER +--echo # +CREATE USER foo@localhost; +CREATE USER bar2@localhost; +RENAME USER foo@localhost TO bar1@localhost, bar1@localhost TO bar3@localhost; +DROP USER bar2@localhost; +DROP USER bar3@localhost; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7f7bd447bad..f1612a7927f 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -10365,9 +10365,9 @@ bool mysql_rename_user(THD *thd, List &list) continue; } some_users_renamed= TRUE; + rebuild_acl_users(); } - rebuild_acl_users(); /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ rebuild_check_host();