summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2005-11-18 16:38:01 +0100
committerunknown <guilhem@mysql.com>2005-11-18 16:38:01 +0100
commit41de6f9a7cfcb39e8461835dfe67dbc24f457bb4 (patch)
tree07e22cfddd8927526e3bb2ef581822106278886f /sql/log.cc
parent081cc1558734f2ee7a674ddacaa2436b2a46d039 (diff)
parent14637f97cdd7ff4a7d60c09052e2e280ee57c957 (diff)
downloadmariadb-git-41de6f9a7cfcb39e8461835dfe67dbc24f457bb4.tar.gz
Merge mysql.com:/home/mysql_src/mysql-5.0
into mysql.com:/home/mysql_src/mysql-5.1-merge-of-5.0 (not all files are good, I'll fix; I'll ask some devs to check their part) BitKeeper/etc/ignore: auto-union include/my_global.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/view.test: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/field.cc: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.h: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_table.cc: Auto merged sql/table.h: Auto merged storage/myisam/mi_key.c: Auto merged storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged storage/ndb/src/ndbapi/NdbImpl.hpp: Auto merged storage/ndb/src/ndbapi/ndb_cluster_connection.cpp: Auto merged support-files/mysql.spec.sh: Auto merged configure.in: merge mysql-test/r/ps_1general.result: merge ("ul", will fix) sql/examples/ha_tina.cc: merge sql/ha_innodb.cc: merge sql/handler.h: merge sql/log.cc: merge sql/set_var.cc: merge sql/share/errmsg.txt: merge (bad, will fix) sql/sql_show.cc: merge (bad, will fix) sql/sql_yacc.yy: merge storage/ndb/src/ndbapi/NdbRecAttr.cpp: merge
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc64
1 files changed, 2 insertions, 62 deletions
diff --git a/sql/log.cc b/sql/log.cc
index c958196c466..593a5ab2bdc 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -77,7 +77,7 @@ handlerton binlog_hton = {
NULL, /* Flush logs */
NULL, /* Show status */
NULL, /* Replication Report Sent Binlog */
- HTON_NOT_USER_SELECTABLE
+ HTON_NOT_USER_SELECTABLE | HTON_HIDDEN
};
@@ -368,8 +368,7 @@ static int find_uniq_filename(char *name)
MYSQL_LOG::MYSQL_LOG()
:bytes_written(0), last_time(0), query_start(0), name(0),
prepared_xids(0), log_type(LOG_CLOSED), file_id(1), open_count(1),
- readers_count(0), reset_pending(FALSE), write_error(FALSE), inited(FALSE),
- need_start_event(TRUE),
+ write_error(FALSE), inited(FALSE), need_start_event(TRUE),
description_event_for_exec(0), description_event_for_queue(0)
{
/*
@@ -396,9 +395,7 @@ void MYSQL_LOG::cleanup()
delete description_event_for_exec;
(void) pthread_mutex_destroy(&LOCK_log);
(void) pthread_mutex_destroy(&LOCK_index);
- (void) pthread_mutex_destroy(&LOCK_readers);
(void) pthread_cond_destroy(&update_cond);
- (void) pthread_cond_destroy(&reset_cond);
}
DBUG_VOID_RETURN;
}
@@ -443,9 +440,7 @@ void MYSQL_LOG::init_pthread_objects()
inited= 1;
(void) pthread_mutex_init(&LOCK_log,MY_MUTEX_INIT_SLOW);
(void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW);
- (void) pthread_mutex_init(&LOCK_readers, MY_MUTEX_INIT_SLOW);
(void) pthread_cond_init(&update_cond, 0);
- (void) pthread_cond_init(&reset_cond, 0);
}
const char *MYSQL_LOG::generate_name(const char *log_name,
@@ -949,12 +944,6 @@ bool MYSQL_LOG::reset_logs(THD* thd)
pthread_mutex_lock(&LOCK_log);
pthread_mutex_lock(&LOCK_index);
- /*
- we need one more lock to block attempts to open a log while
- we are waiting untill all log files will be closed
- */
- pthread_mutex_lock(&LOCK_readers);
-
/*
The following mutex is needed to ensure that no threads call
'delete thd' as we would then risk missing a 'rollback' from this
@@ -977,19 +966,6 @@ bool MYSQL_LOG::reset_logs(THD* thd)
goto err;
}
- reset_pending= TRUE;
- /*
- send update signal just in case so that all reader threads waiting
- for log update will leave wait condition
- */
- signal_update();
- /*
- if there are active readers wait until all of them will
- release opened files
- */
- while (readers_count)
- pthread_cond_wait(&reset_cond, &LOCK_log);
-
for (;;)
{
my_delete(linfo.log_file_name, MYF(MY_WME));
@@ -1008,10 +984,7 @@ bool MYSQL_LOG::reset_logs(THD* thd)
my_free((gptr) save_name, MYF(0));
err:
- reset_pending= FALSE;
-
(void) pthread_mutex_unlock(&LOCK_thread_count);
- pthread_mutex_unlock(&LOCK_readers);
pthread_mutex_unlock(&LOCK_index);
pthread_mutex_unlock(&LOCK_log);
DBUG_RETURN(error);
@@ -2085,12 +2058,6 @@ void MYSQL_LOG::wait_for_update(THD* thd, bool is_slave)
{
const char *old_msg;
DBUG_ENTER("wait_for_update");
-
- if (reset_pending)
- {
- pthread_mutex_unlock(&LOCK_log);
- DBUG_VOID_RETURN;
- }
old_msg= thd->enter_cond(&update_cond, &LOCK_log,
is_slave ?
@@ -2342,33 +2309,6 @@ void MYSQL_LOG::signal_update()
DBUG_VOID_RETURN;
}
-void MYSQL_LOG::readers_addref()
-{
- /*
- There is no necessity for reference counting on *nix, since it allows to
- delete opened files, however it is more clean way to wait
- untill all files will be closed on *nix as well.
- */
- DBUG_ENTER("MYSQL_LOG::reader_addref");
- pthread_mutex_lock(&LOCK_log);
- pthread_mutex_lock(&LOCK_readers);
- readers_count++;
- pthread_mutex_unlock(&LOCK_readers);
- pthread_mutex_unlock(&LOCK_log);
- DBUG_VOID_RETURN;
-}
-
-void MYSQL_LOG::readers_release()
-{
- DBUG_ENTER("MYSQL_LOG::reader_release");
- pthread_mutex_lock(&LOCK_log);
- readers_count--;
- if (!readers_count)
- pthread_cond_broadcast(&reset_cond);
- pthread_mutex_unlock(&LOCK_log);
- DBUG_VOID_RETURN;
-}
-
#ifdef __NT__
void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
uint length, int buffLen)