mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Bug#17733 Flushing logs causes daily server crash
Server crashes if a flush commmand is issued and binlog is closed. - added check to prevent binlog access when binlog file isn't opened.
This commit is contained in:
@@ -4008,8 +4008,9 @@ end_with_restore_list:
|
||||
case SQLCOM_FLUSH:
|
||||
{
|
||||
bool write_to_binlog;
|
||||
if (check_global_access(thd,RELOAD_ACL) || check_db_used(thd, all_tables))
|
||||
if (check_global_access(thd,RELOAD_ACL))
|
||||
goto error;
|
||||
|
||||
/*
|
||||
reload_acl_and_cache() will tell us if we are allowed to write to the
|
||||
binlog or not.
|
||||
@@ -4030,7 +4031,8 @@ end_with_restore_list:
|
||||
}
|
||||
}
|
||||
send_ok(thd);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case SQLCOM_KILL:
|
||||
@@ -6696,7 +6698,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
|
||||
tmp_write_to_binlog= 0;
|
||||
mysql_log.new_file(1);
|
||||
mysql_slow_log.new_file(1);
|
||||
mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
|
||||
if( mysql_bin_log.is_open() )
|
||||
{
|
||||
mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE);
|
||||
}
|
||||
#ifdef HAVE_REPLICATION
|
||||
pthread_mutex_lock(&LOCK_active_mi);
|
||||
rotate_relay_log(active_mi);
|
||||
|
Reference in New Issue
Block a user