summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-10-31 22:20:51 +0100
committerSergei Golubchik <serg@mariadb.org>2018-11-01 15:48:15 +0100
commitdd6e74c62a2aa44d9d5e1790bcd36d3ff1c7d98b (patch)
tree44da24ca43ad7785d1f62679448b9d696f230f9a /sql/sql_acl.cc
parentabcd09c95a49d02bf136a21d62d38a2d03672f26 (diff)
downloadmariadb-git-dd6e74c62a2aa44d9d5e1790bcd36d3ff1c7d98b.tar.gz
MDEV-16774 SET PASSWORD and ALTER USER with slightly different results
set both `password` and `authentication_string` columns in `mysql`.`user` table for now. Suppress the "password was ignored" warning if the password is the same as the authentication string
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 733d844e5e4..fd213c528e1 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2056,7 +2056,9 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
user_table.authentication_string()));
user.auth_string.length= strlen(user.auth_string.str);
- if (user.auth_string.length && password_len)
+ if (user.auth_string.length && password_len &&
+ (user.auth_string.length != password_len ||
+ memcmp(user.auth_string.str, password, password_len)))
{
sql_print_warning("'user' entry '%s@%s' has both a password "
"and an authentication plugin specified. The "
@@ -3927,7 +3929,6 @@ static bool update_user_table(THD *thd, const User_table& user_table,
{
set_authentication_plugin_from_password(user_table, new_password,
new_password_len);
- new_password_len= 0;
}
if (user_table.password())