diff options
author | unknown <mats@mysql.com> | 2004-11-25 12:23:41 +0100 |
---|---|---|
committer | unknown <mats@mysql.com> | 2004-11-25 12:23:41 +0100 |
commit | c4dbf1e969253f3b65106036af0f47a600a77ad5 (patch) | |
tree | dbd5eed33a764e82c97cd90f56cdda2eb22fef63 /sql/slave.cc | |
parent | 32c3009d3a8bd1a0ea591977cf878795625e592c (diff) | |
parent | 467c481479ac511cc445b9703260e9b3bb8b2e96 (diff) | |
download | mariadb-git-c4dbf1e969253f3b65106036af0f47a600a77ad5.tar.gz |
Merge
BitKeeper/etc/logging_ok:
auto-union
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sql_repl.cc:
Auto merged
sql/repl_failsafe.cc:
Merging 4.0 and 4.1 changes.
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 6bc977e8d41..6d5c997bade 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -161,7 +161,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; @@ -1799,7 +1799,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]; @@ -1813,8 +1814,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); } |