mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
merge with 5.1
This commit is contained in:
@ -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)))
|
||||
@ -1671,6 +1680,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);
|
||||
}
|
||||
|
||||
@ -5509,7 +5524,7 @@ static int handle_grant_struct(uint struct_no, bool drop,
|
||||
host= grant_name->host.hostname;
|
||||
break;
|
||||
default:
|
||||
DBUG_ASSERT(0);
|
||||
MY_ASSERT_UNREACHABLE();
|
||||
}
|
||||
if (! user)
|
||||
user= "";
|
||||
|
Reference in New Issue
Block a user