Commit fc40e759 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

Docs/manual.texi

    added updated for FLUSH LOGS and replication
sql/log.cc
    fixed the log rotation bug when the log name did not change after
    FLUSH LOGS
parent 50486eeb
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -23935,8 +23935,13 @@ of the are available starting in 3.23.15 unless indicated otherwise.
@code{log-bin} 
 @tab Should be set on the master. Tells it to keep a binary update log. 
If a parameter is specified, the log will be written to the specified 
location.
(Set on @strong{Master}, Example: @code{log-bin})
location. Note that if you give it a parameter with an extention 
(eg. @code{log-bin=/mysql/logs/replication.log} ) versions up to 
3.23.24 will not work right during replication if you do 
@code{FLUSH LOGS} . The problem is fixed
in 3.23.25. If you are using this kind of log name, @code{FLUSH LOGS}
will be ignored on binlog. To clear the log, run @code{FLUSH MASTER},
and do not forget to run @code{FLUSH SLAVE} on all slaves. 
@item 
@code{log-bin-index} 
@@ -36742,6 +36747,9 @@ though, so 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.25
@itemize @bullet
@item
@code{FLUSH LOGS} broke replication if one had @code{log-bin} with 
a log with explicit extension 
@item
Fixed a bug in MyISAM with packed multi-part keys.
@item
Fixed crash when using @code{CHECK TABLE} on Windows.
+7 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ static int find_uniq_filename(char *name)


MYSQL_LOG::MYSQL_LOG(): file(0),index_file(0),last_time(0),query_start(0),
			name(0), log_type(LOG_CLOSED),write_error(0),inited(0)
			name(0), log_type(LOG_CLOSED),write_error(0),inited(0),
			no_rotate(0)
{
  /*
    We don't want to intialize LOCK_Log here as the thread system may
@@ -133,6 +134,8 @@ void MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
    inited=1;
    (void) pthread_mutex_init(&LOCK_log,NULL);
    (void) pthread_mutex_init(&LOCK_index, NULL);
    if(log_type_arg == LOG_BIN && *fn_ext(log_name))
      no_rotate = 1;
  }

  log_type=log_type_arg;
@@ -320,6 +323,9 @@ void MYSQL_LOG::new_file()
{
  if (file)
  {
    if(no_rotate) // do not rotate logs that are marked non-rotatable
      return;     // ( for binlog with constant name)
    
    char new_name[FN_REFLEN], *old_name=name;
    VOID(pthread_mutex_lock(&LOCK_log));
    if (generate_new_name(new_name, name))
+4 −0
Original line number Diff line number Diff line
@@ -85,6 +85,10 @@ class MYSQL_LOG {
  char time_buff[20],db[NAME_LEN+1];
  char log_file_name[FN_REFLEN],index_file_name[FN_REFLEN];
  bool write_error,inited;
  bool no_rotate; // for binlog - if log name can never change
  // we should not try to rotate it or write any rotation events
  // the user should use FLUSH MASTER instead of FLUSH LOGS for
  // purging

public:
  MYSQL_LOG();