Commit b1c41e11 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-17932 : assertion in multi RENAME USER command.

Sort acl_users inside the mysql_rename_user()'s loop, after every
successful iteration.

This is needed because on the next loop's iteration find_user_exact()
is used, which requires correct sorting by name.
parent a80f5fdb
......@@ -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;
......@@ -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;
......@@ -10365,9 +10365,9 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &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();
......
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