From d7cfbff5b0a53ba22bb731dec70c4886d2ff9570 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Apr 2002 21:46:23 -0700 Subject: relay_log_space_limit DBUG_ macro cleanup buffer boundary cleanup This changeset, although not fully tested, works for me better than anything I've had so far, including what is in the repository. I will push it unless something crashes while I am writing this :-) mysql-test/r/rpl000014.result: updated result mysql-test/r/rpl000015.result: updated result mysql-test/r/rpl000016.result: updated result mysql-test/r/rpl_log.result: new result mysys/mf_iocache.c: DBUG_ cleanup mysys/mf_iocache2.c: DBUG_ fix sql/log.cc: added relay_log_space_limit sql/mysqld.cc: relay_log_space_limit sql/slave.cc: relay_log_space_limit sql/slave.h: relay_log_space_limit sql/sql_class.h: relay_log_space_limit sql/sql_repl.cc: fixed buffer overrun bug --- sql/sql_class.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 289a2ab9255..d8824e80686 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -78,12 +78,29 @@ class MYSQL_LOG { bool need_start_event; pthread_cond_t update_cond; bool no_auto_events; // for relay binlog + ulonglong bytes_written; friend class Log_event; public: MYSQL_LOG(); ~MYSQL_LOG(); pthread_mutex_t* get_log_lock() { return &LOCK_log; } + void reset_bytes_written() + { + bytes_written = 0; + } + void harvest_bytes_written(ulonglong* counter) + { +#ifndef DBUG_OFF + char buf1[22],buf2[22]; +#endif + DBUG_ENTER("harvest_bytes_written"); + (*counter)+=bytes_written; + DBUG_PRINT("info",("counter=%s,bytes_written=%s", llstr(*counter,buf1), + llstr(bytes_written,buf2))); + bytes_written=0; + DBUG_VOID_RETURN; + } IO_CACHE* get_log_file() { return &log_file; } void signal_update() { pthread_cond_broadcast(&update_cond);} void wait_for_update(THD* thd); -- cgit v1.2.1