summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@oracle.com>2010-12-07 16:11:13 +0000
committerLuis Soares <luis.soares@oracle.com>2010-12-07 16:11:13 +0000
commit5d6e142b2b9a5973fc9b9a638e01e5b92223e4c8 (patch)
treeb5babca4ee608dc5e5daf9722eeb5c8414974565 /sql/sql_parse.cc
parentc872e3db8027e4e4638af9bd80b9d78c8a675a77 (diff)
parentbd0709cc8726e2d189df71138488ff7b2b004460 (diff)
downloadmariadb-git-5d6e142b2b9a5973fc9b9a638e01e5b92223e4c8.tar.gz
BUG#46166
Manual merge from mysql-5.1-bugteam into mysql-5.5-bugteam. Conflicts ========= Text conflict in sql/log.cc Text conflict in sql/log.h Text conflict in sql/slave.cc Text conflict in sql/sql_parse.cc Text conflict in sql/sql_priv.h
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc31
1 files changed, 22 insertions, 9 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 40cecb75b69..bcf487334a0 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1215,7 +1215,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#endif
case COM_REFRESH:
{
- bool not_used;
+ int not_used;
status_var_increment(thd->status_var.com_stat[SQLCOM_FLUSH]);
ulong options= (ulong) (uchar) packet[0];
if (trans_commit_implicit(thd))
@@ -2773,7 +2773,11 @@ end_with_restore_list:
{
Incident_log_event ev(thd, incident);
(void) mysql_bin_log.write(&ev); /* error is ignored */
- mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
+ if (mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE))
+ {
+ res= 1;
+ break;
+ }
}
DBUG_PRINT("debug", ("Just after generate_incident()"));
}
@@ -3509,8 +3513,7 @@ end_with_restore_list:
lex->no_write_to_binlog= 1;
case SQLCOM_FLUSH:
{
- bool write_to_binlog;
-
+ int write_to_binlog;
if (check_global_access(thd,RELOAD_ACL))
goto error;
@@ -3539,12 +3542,22 @@ end_with_restore_list:
/*
Presumably, RESET and binlog writing doesn't require synchronization
*/
- if (!lex->no_write_to_binlog && write_to_binlog)
+
+ if (write_to_binlog > 0) // we should write
+ {
+ if (!lex->no_write_to_binlog)
+ res= write_bin_log(thd, FALSE, thd->query(), thd->query_length());
+ } else if (write_to_binlog < 0)
{
- if ((res= write_bin_log(thd, FALSE, thd->query(), thd->query_length())))
- break;
- }
- my_ok(thd);
+ /*
+ We should not write, but rather report error because
+ reload_acl_and_cache binlog interactions failed
+ */
+ res= 1;
+ }
+
+ if (!res)
+ my_ok(thd);
}
break;