diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-11-26 13:44:49 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-11-26 13:44:49 +0000 |
commit | 42af43e37542d27b8b53677174642c4d4326778e (patch) | |
tree | c7ac4c11ee0cfec1ed32d3fecc46d396019403e3 /sql/slave.cc | |
parent | 8d97c013664e878490f65f0158fb978a24451e60 (diff) | |
parent | b0d586e5648e78981c63e68059c6c836a228a082 (diff) | |
download | mariadb-git-42af43e37542d27b8b53677174642c4d4326778e.tar.gz |
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
BitKeeper/etc/logging_ok:
auto-union
innobase/buf/buf0buf.c:
Auto merged
innobase/buf/buf0lru.c:
Auto merged
innobase/row/row0mysql.c:
Auto merged
innobase/row/row0sel.c:
Auto merged
ndb/src/mgmsrv/main.cpp:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_repl.cc:
Auto merged
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 04ab4830312..dbe58275b9c 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -160,7 +160,7 @@ int init_slave() } if (init_master_info(active_mi,master_info_file,relay_log_info_file, - !master_host)) + !master_host, (SLAVE_IO | SLAVE_SQL))) { sql_print_error("Failed to initialize the master info structure"); goto err; @@ -1981,7 +1981,8 @@ void clear_until_condition(RELAY_LOG_INFO* rli) int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, - bool abort_if_no_master_info_file) + bool abort_if_no_master_info_file, + int thread_mask) { int fd,error; char fname[FN_REFLEN+128]; @@ -1995,8 +1996,15 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname, last time. If this case pos_in_file would be set and we would get a crash when trying to read the signature for the binary relay log. + + We only rewind the read position if we are starting the SQL + thread. The handle_slave_sql thread assumes that the read + position is at the beginning of the file, and will read the + "signature" and then fast-forward to the last position read. */ - my_b_seek(mi->rli.cur_log, (my_off_t) 0); + if (thread_mask & SLAVE_SQL) { + my_b_seek(mi->rli.cur_log, (my_off_t) 0); + } DBUG_RETURN(0); } |