diff options
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 2a92bef4cf6..1ee443cfb83 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2763,12 +2763,20 @@ bool change_password(THD *thd, LEX_USER *user) enum_binlog_format save_binlog_format; int result=0; const CSET_STRING query_save __attribute__((unused)) = thd->query_string; - DBUG_ENTER("change_password"); DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'", user->host.str, user->user.str, user->password.str)); DBUG_ASSERT(user->host.str != 0); // Ensured by parent + /* + This statement will be replicated as a statement, even when using + row-based replication. The flag will be reset at the end of the + statement. + This has to be handled here as it's called by set_var.cc, which is + not automaticly handled by sql_parse.cc + */ + save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); + if (mysql_bin_log.is_open() || (WSREP(thd) && !IF_WSREP(thd->wsrep_applier, 0))) { @@ -2788,15 +2796,6 @@ bool change_password(THD *thd, LEX_USER *user) result= 1; - /* - This statement will be replicated as a statement, even when using - row-based replication. The flag will be reset at the end of the - statement. - This has to be handled here as it's called by set_var.cc, which is - not automaticly handled by sql_parse.cc - */ - save_binlog_format= thd->set_current_stmt_binlog_format_stmt(); - mysql_mutex_lock(&acl_cache->lock); ACL_USER *acl_user; if (!(acl_user= find_user_exact(user->host.str, user->user.str))) @@ -2842,7 +2841,7 @@ end: close_mysql_tables(thd); #ifdef WITH_WSREP -error: // this label is used in WSREP_TO_ISOLATION_END +error: // this label is used in WSREP_TO_ISOLATION_BEGIN if (WSREP(thd) && !thd->wsrep_applier) { WSREP_TO_ISOLATION_END; |