#At file:///home/acorreia/workspace.sun/repository.mysql.new/bzrwork/bug-57098/mysql-5.1-bugteam/ based on revid:georgi.kodinov@stripped
3523 Alfranio Correia 2010-10-06
BUG#57098 RBR breaks on changing user password on 5.1 master -> 5.5 slave
Backported the patch for BUG#55452.
modified:
sql/sql_acl.cc
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2010-07-20 18:07:36 +0000
+++ b/sql/sql_acl.cc 2010-10-06 10:19:51 +0000
@@ -1593,6 +1593,7 @@ bool change_password(THD *thd, const cha
/* 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 cha
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 cha
}
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);
}
Attachment: [text/bzr-bundle] bzr/alfranio.correia@oracle.com-20101006101951-2zyih08jgl893o16.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (alfranio.correia:3523) Bug#57098 | Alfranio Correia | 6 Oct |