summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@oracle.com>2010-10-06 11:19:51 +0100
committerAlfranio Correia <alfranio.correia@oracle.com>2010-10-06 11:19:51 +0100
commit361833796f3ddbcc1641a941ee0fb55a90b8e0cc (patch)
tree5dc90c01922932029d8534c93efac80eb7b33bd9 /sql/sql_acl.cc
parent58995280cc60503f4c13560a7e6e07556d2640db (diff)
downloadmariadb-git-361833796f3ddbcc1641a941ee0fb55a90b8e0cc.tar.gz
BUG#57098 RBR breaks on changing user password on 5.1 master -> 5.5 slave
Backported the patch for BUG#55452.
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index b507b70d1fb..ea002f59fe3 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1593,6 +1593,7 @@ bool change_password(THD *thd, const char *host, const char *user,
/* Buffer should be extended when password length is extended. */
char buff[512];
ulong query_length;
+ bool save_binlog_row_based;
uint new_password_len= (uint) strlen(new_password);
bool result= 1;
DBUG_ENTER("change_password");
@@ -1628,6 +1629,14 @@ bool change_password(THD *thd, const char *host, const char *user,
if (!(table= open_ltable(thd, &tables, TL_WRITE, 0)))
DBUG_RETURN(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.
+ */
+ if ((save_binlog_row_based= thd->current_stmt_binlog_row_based))
+ thd->clear_current_stmt_binlog_row_based();
+
VOID(pthread_mutex_lock(&acl_cache->lock));
ACL_USER *acl_user;
if (!(acl_user= find_acl_user(host, user, TRUE)))
@@ -1663,6 +1672,12 @@ bool change_password(THD *thd, const char *host, const char *user,
}
end:
close_thread_tables(thd);
+
+ /* Restore the state of binlog format */
+ DBUG_ASSERT(!thd->current_stmt_binlog_row_based);
+ if (save_binlog_row_based)
+ thd->set_current_stmt_binlog_row_based();
+
DBUG_RETURN(result);
}