diff options
author | unknown <sasha@mysql.sashanet.com> | 2002-01-26 22:26:24 -0700 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2002-01-26 22:26:24 -0700 |
commit | 83666b3e54fb1ae572f1125bfc171b42c9692436 (patch) | |
tree | 7805cfd6c7eb661c4f3022b7fc37478a0908a190 /mysys/mf_iocache2.c | |
parent | 845db7c20ba28e014c5a36a6c95afd8ed111f316 (diff) | |
download | mariadb-git-83666b3e54fb1ae572f1125bfc171b42c9692436.tar.gz |
misc replication bugfixes including some needed modifications in IO_CACHE
likely() and unlikely() branch prediction compiler hint macros
clean-up of comments
include/my_global.h:
added likely() and unlikely() macros to help some compilers optimize
the code for architecture-specific branch prediction policies
include/my_sys.h:
coverted my_b_append_tell() from macro to a function as it needed to be more
complex to avoid a potential race condition
mysql-test/mysql-test-run.sh:
hostname-independent relay log name to have consistent SHOW SLAVE STATUS
output
mysql-test/r/rpl000014.result:
result update
mysql-test/r/rpl000015.result:
result update
mysql-test/r/rpl000016.result:
result update
mysql-test/r/rpl_log.result:
result update
mysql-test/t/rpl000017-slave.sh:
proper cleanup of old logs
mysys/mf_iocache.c:
cosmetic changes + more debugging asserts
mysys/mf_iocache2.c:
my_b_append_tell()
cleanup of comments
sql/log.cc:
fix potential bug - do not rotate log in the middle of event
sql/slave.cc:
do not write stop events when the server does not actually stop but just
rotates the log
fixed race between queue_event() and show_slave_status()
clean-up of comments
sql/slave.h:
added ignore_stop_event flag to SLAVE_LOG_INFO
Diffstat (limited to 'mysys/mf_iocache2.c')
-rw-r--r-- | mysys/mf_iocache2.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c index ca9c9938cd2..a343829d32e 100644 --- a/mysys/mf_iocache2.c +++ b/mysys/mf_iocache2.c @@ -23,10 +23,30 @@ #include <m_string.h> #include <stdarg.h> #include <m_ctype.h> +#include <assert.h> + +my_off_t my_b_append_tell(IO_CACHE* info) +{ + my_off_t res; +/* we need to lock the append buffer mutex to keep flush_io_cache() + from messing with the variables that we need in order to provide the + answer to the question. +*/ +#ifdef THREAD + pthread_mutex_lock(&info->append_buffer_lock); +#endif + DBUG_ASSERT(info->end_of_file - (info->append_read_pos-info->write_buffer) + == my_tell(info->file,MYF(0))); + res = info->end_of_file + (info->write_pos-info->append_read_pos); +#ifdef THREAD + pthread_mutex_unlock(&info->append_buffer_lock); +#endif + return res; +} /* - Fix that next read will be made at certain position - For write cache, make next write happen at a certain position + Make next read happen at the given position + For write cache, make next write happen at the given position */ void my_b_seek(IO_CACHE *info,my_off_t pos) |