Bug #84344 | ALTER USER with empty password replicates incorrectly | ||
---|---|---|---|
Submitted: | 27 Dec 2016 8:29 | Modified: | 6 Jan 2017 8:21 |
Reporter: | team phx (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.7, 5.7.17 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | password, replication |
[27 Dec 2016 8:29]
team phx
[27 Dec 2016 8:59]
MySQL Verification Team
Hello team phx, Thank you for the report. Verified as described with 5.7.17 build. Thanks, Umesh
[6 Jan 2017 8:21]
team phx
This patch should fix the bug. Patch is diff with mysql 5.7.17. diff --git a/sql/auth/sql_user.cc b/sql/auth/sql_user.cc index cb0e11b..9bb4268 100644 --- a/sql/auth/sql_user.cc +++ b/sql/auth/sql_user.cc @@ -176,6 +176,12 @@ void append_user_new(THD *thd, String *str, LEX_USER *user, bool comma= true) else append_query_string(thd, system_charset_info, &from_auth, str); } + else if (thd->lex->sql_command == SQLCOM_ALTER_USER) + { + /* ALTER USER must come with AS .., otherwise password will be marked expired */ + if (user->uses_identified_by_clause) + str->append(STRING_WITH_LEN(" AS ''")); + } } } }