diff options
author | unknown <guilhem@mysql.com> | 2003-07-12 15:48:26 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2003-07-12 15:48:26 +0200 |
commit | 5526d454fdae0d8bbaf580c8d322c11f2c6deed1 (patch) | |
tree | 71b83417d4c94c3c228d1e59ebfaf80c8bcb6a6a /sql/log.cc | |
parent | 351a03df7a68ed539ac2fe2e4de6c769869c387b (diff) | |
download | mariadb-git-5526d454fdae0d8bbaf580c8d322c11f2c6deed1.tar.gz |
Member no_rotate in MYSQL_LOG was always 0, I delete it.
sql/log.cc:
Member no_rotate of MYSQL_LOG is useless; this shows it for sure:
[guilhem@gbichot2 mysql-4.0]$ bk -r grep no_rotate
sql/log.cc 1.83 no_rotate(0), need_start_event(1)
sql/log.cc 1.75 if (no_rotate)
sql/log.cc 1.89 if (!no_rotate)
sql/sql_class.h 1.119 bool no_rotate;
i.e. no_rotate is 0 all the time. So we don't need it.
Biggest part of the patch is indentation change.
sql/sql_class.h:
suppress no_rotate
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 73 |
1 files changed, 31 insertions, 42 deletions
diff --git a/sql/log.cc b/sql/log.cc index 912cdf0a1a8..96e1f1a2e01 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -83,7 +83,7 @@ static int find_uniq_filename(char *name) MYSQL_LOG::MYSQL_LOG() :bytes_written(0), last_time(0), query_start(0), name(0), file_id(1), open_count(1), log_type(LOG_CLOSED), write_error(0), - no_rotate(0), need_start_event(1) + need_start_event(1) { /* We don't want to initialize LOCK_Log here as such initialization depends on @@ -721,7 +721,6 @@ err: RETURN VALUES 0 ok - LOG_INFO_PURGE_NO_ROTATE Binary file that can't be rotated LOG_INFO_EOF to_log not found */ @@ -731,9 +730,6 @@ int MYSQL_LOG::purge_logs(THD* thd, const char* to_log) LOG_INFO log_info; DBUG_ENTER("purge_logs"); - if (no_rotate) - DBUG_RETURN(LOG_INFO_PURGE_NO_ROTATE); - pthread_mutex_lock(&LOCK_index); if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/))) goto err; @@ -840,49 +836,42 @@ void MYSQL_LOG::new_file(bool need_lock) new_name_ptr= name; /* - Only rotate open logs that are marked non-rotatable - (binlog with constant name are non-rotatable) + If user hasn't specified an extension, generate a new log name + We have to do this here and not in open as we want to store the + new file name in the current binary log file. */ - if (!no_rotate) + if (generate_new_name(new_name, name)) + goto end; + new_name_ptr=new_name; + + if (log_type == LOG_BIN) { - /* - If user hasn't specified an extension, generate a new log name - We have to do this here and not in open as we want to store the - new file name in the current binary log file. - */ - if (generate_new_name(new_name, name)) - goto end; - new_name_ptr=new_name; - - if (log_type == LOG_BIN) + if (!no_auto_events) { - if (!no_auto_events) - { - /* - We log the whole file name for log file as the user may decide - to change base names at some point. - */ - THD* thd = current_thd; - Rotate_log_event r(thd,new_name+dirname_length(new_name)); - r.set_log_pos(this); - - /* - Because this log rotation could have been initiated by a master of - the slave running with log-bin, we set the flag on rotate - event to prevent infinite log rotation loop - */ - if (thd->slave_thread) - r.flags|= LOG_EVENT_FORCED_ROTATE_F; - r.write(&log_file); - bytes_written += r.get_event_len(); - } /* - Update needs to be signalled even if there is no rotate event - log rotation should give the waiting thread a signal to - discover EOF and move on to the next log. + We log the whole file name for log file as the user may decide + to change base names at some point. + */ + THD* thd = current_thd; + Rotate_log_event r(thd,new_name+dirname_length(new_name)); + r.set_log_pos(this); + + /* + Because this log rotation could have been initiated by a master of + the slave running with log-bin, we set the flag on rotate + event to prevent infinite log rotation loop */ - signal_update(); + if (thd->slave_thread) + r.flags|= LOG_EVENT_FORCED_ROTATE_F; + r.write(&log_file); + bytes_written += r.get_event_len(); } + /* + Update needs to be signalled even if there is no rotate event + log rotation should give the waiting thread a signal to + discover EOF and move on to the next log. + */ + signal_update(); } old_name=name; save_log_type=log_type; |