summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <Dao-Gang.Qu@sun.com>2010-01-25 10:55:05 +0800
committerunknown <Dao-Gang.Qu@sun.com>2010-01-25 10:55:05 +0800
commitdad4291b781495cfdc8abac9dc2902621bfb3b56 (patch)
tree79b80f370265c5019547a5ef30b218665a358d84 /sql/sql_acl.cc
parent3cae7d1187795a8089b6f54ac60cf2a0e579cf89 (diff)
parent2b16517522afad76bc94b07bdaa8af64091e713b (diff)
downloadmariadb-git-dad4291b781495cfdc8abac9dc2902621bfb3b56.tar.gz
Manual merge with Conflicts:
sql_udf.cc
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index e2c47957e4d..a8828d15cae 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1659,8 +1659,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);
@@ -3225,7 +3225,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);
@@ -3401,7 +3401,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);
@@ -3530,7 +3531,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);
@@ -5752,7 +5753,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);
@@ -5833,7 +5834,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);
@@ -5926,7 +5927,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);
@@ -6116,17 +6117,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);
}