mirror of
https://github.com/MariaDB/server.git
synced 2025-12-03 05:41:09 +03:00
BUG#46166
Merging to latest mysql-5.5-bugteam.
This commit is contained in:
@@ -1218,7 +1218,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))
|
||||
@@ -2780,7 +2780,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()"));
|
||||
}
|
||||
@@ -3516,8 +3520,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;
|
||||
|
||||
@@ -3546,12 +3549,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;
|
||||
|
||||
Reference in New Issue
Block a user