mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Manual merge from mysql-5.1-bugteam.
Conflicts: - sql/mysql_priv.h
This commit is contained in:
@@ -1660,8 +1660,8 @@ bool change_password(THD *thd, const char *host, const char *user,
|
||||
acl_user->host.hostname ? acl_user->host.hostname : "",
|
||||
new_password));
|
||||
thd->clear_error();
|
||||
thd->binlog_query(THD::MYSQL_QUERY_TYPE, buff, query_length,
|
||||
FALSE, FALSE, 0);
|
||||
result= thd->binlog_query(THD::MYSQL_QUERY_TYPE, buff, query_length,
|
||||
FALSE, FALSE, 0);
|
||||
}
|
||||
end:
|
||||
close_thread_tables(thd);
|
||||
@@ -3228,7 +3228,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
||||
|
||||
if (!result) /* success */
|
||||
{
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
result= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
}
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
@@ -3404,7 +3404,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
|
||||
|
||||
if (write_to_binlog)
|
||||
{
|
||||
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
if (write_bin_log(thd, FALSE, thd->query(), thd->query_length()))
|
||||
result= TRUE;
|
||||
}
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
@@ -3533,7 +3534,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
|
||||
|
||||
if (!result)
|
||||
{
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
result= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
}
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
@@ -5865,7 +5866,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
|
||||
my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr_safe());
|
||||
|
||||
if (some_users_created)
|
||||
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
@@ -5946,7 +5947,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
|
||||
my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe());
|
||||
|
||||
if (some_users_deleted)
|
||||
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
@@ -6039,7 +6040,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
|
||||
my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr_safe());
|
||||
|
||||
if (some_users_renamed && mysql_bin_log.is_open())
|
||||
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
@@ -6229,17 +6230,19 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
|
||||
|
||||
VOID(pthread_mutex_unlock(&acl_cache->lock));
|
||||
|
||||
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
int binlog_error=
|
||||
write_bin_log(thd, FALSE, thd->query(), thd->query_length());
|
||||
|
||||
rw_unlock(&LOCK_grant);
|
||||
close_thread_tables(thd);
|
||||
|
||||
if (result)
|
||||
/* error for writing binary log has already been reported */
|
||||
if (result && !binlog_error)
|
||||
my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0));
|
||||
/* Restore the state of binlog format */
|
||||
thd->current_stmt_binlog_row_based= save_binlog_row_based;
|
||||
|
||||
DBUG_RETURN(result);
|
||||
DBUG_RETURN(result || binlog_error);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user