diff options
author | unknown <serg@serg.mylan> | 2005-03-09 12:29:51 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2005-03-09 12:29:51 +0100 |
commit | a0f63f1b81bbe1b6312abab035cbf622970023cb (patch) | |
tree | 95219d3b710ca7440791ed606fa1dbbec32d170a /sql | |
parent | b7943b7aee28e468e58436abf856d7f93496e547 (diff) | |
download | mariadb-git-a0f63f1b81bbe1b6312abab035cbf622970023cb.tar.gz |
don't close binlog in the destructor - use explictit MYSQL_LOG::cleanup for this
mysql-test/r/fulltext.result:
new test, duplicate test removed
mysql-test/t/fulltext.test:
new test, duplicate test removed
sql/slave.cc:
close relay log explicitly
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 16 | ||||
-rw-r--r-- | sql/slave.cc | 1 | ||||
-rw-r--r-- | sql/sql_class.h | 6 |
3 files changed, 12 insertions, 11 deletions
diff --git a/sql/log.cc b/sql/log.cc index 5d77197a9b9..ae06e37611d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -360,12 +360,6 @@ MYSQL_LOG::MYSQL_LOG() bzero((char*) &index_file, sizeof(index_file)); } - -MYSQL_LOG::~MYSQL_LOG() -{ - cleanup(); -} - /* this is called only once */ void MYSQL_LOG::cleanup() @@ -1276,8 +1270,7 @@ bool MYSQL_LOG::is_active(const char *log_file_name_arg) SYNOPSIS new_file() - need_lock Set to 1 (default) if caller has not locked - LOCK_log and LOCK_index + need_lock Set to 1 if caller has not locked LOCK_log NOTE The new file name is stored last in the index file @@ -1764,12 +1757,13 @@ err: void MYSQL_LOG::rotate_and_purge(uint flags) { + if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)) + pthread_mutex_lock(&LOCK_log); if ((flags & RP_FORCE_ROTATE) || (my_b_tell(&log_file) >= (my_off_t) max_size)) { - new_file(!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)); + new_file(0); #ifdef HAVE_REPLICATION - // QQ why do we need #ifdef here ??? if (expire_logs_days) { long purge_time= time(0) - expire_logs_days*24*60*60; @@ -1778,6 +1772,8 @@ void MYSQL_LOG::rotate_and_purge(uint flags) } #endif } + if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)) + pthread_mutex_unlock(&LOCK_log); } uint MYSQL_LOG::next_file_id() diff --git a/sql/slave.cc b/sql/slave.cc index 9849feaf6fa..90753572e50 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2558,6 +2558,7 @@ st_relay_log_info::~st_relay_log_info() pthread_cond_destroy(&start_cond); pthread_cond_destroy(&stop_cond); pthread_cond_destroy(&log_space_cond); + relay_log.cleanup(); } /* diff --git a/sql/sql_class.h b/sql/sql_class.h index ff30faf1150..67173e972ac 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -236,7 +236,11 @@ class MYSQL_LOG: public TC_LOG public: MYSQL_LOG(); - ~MYSQL_LOG(); + /* + note that there's no destructor ~MYSQL_LOG() ! + The reason is that we don't want it to be automatically called + on exit() - but only during the correct shutdown process + */ int open(const char *opt_name); void close(); |