summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-07-10 18:08:37 -0600
committerunknown <sasha@mysql.sashanet.com>2001-07-10 18:08:37 -0600
commit586648ccc20acd29f4d7f072416ed36f0d9b3a3e (patch)
tree918623c8d3e11e080897527e76b707833b1add58 /sql/sql_repl.cc
parent4ecea7d3a0209e18427c2453e12b35b0c6aabb40 (diff)
downloadmariadb-git-586648ccc20acd29f4d7f072416ed36f0d9b3a3e.tar.gz
mysql-test/t/rpl_sporadic_master.test
fixed test case to produce same results on txn-enabled binary. temporary fix - permanent fix is it make mysqld behave the same with MyISAM on auto_increment insert after delete from tbl_name regardless of how the binary was compiled sql/slave.cc fixed concurrency bug with log_seq sql/slave.h last_log_seq needs to be updated atomically with pos sql/sql_repl.cc cleared up comment and fixed concurrency bug mysql-test/t/rpl_sporadic_master.test: fixed test case to produce same results on txn-enabled binary. temporary fix - permanent fix is it make mysqld behave the same with MyISAM on auto_increment insert after delete from tbl_name regardless of how the binary was compiled sql/slave.cc: fixed concurrency bug with log_seq sql/slave.h: last_log_seq needs to be updated atomically with pos sql/sql_repl.cc: cleared up comment and fixed concurrency bug
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 176122a3f59..4841da1b0a2 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
// Sasha Pachev <sasha@mysql.com> is currently in charge of this file
-// Do not mess with it without his permission!
#include "mysql_priv.h"
#include "sql_repl.h"
@@ -259,9 +258,10 @@ void adjust_linfo_offsets(my_off_t purge_offset)
if ((linfo = tmp->current_linfo))
{
pthread_mutex_lock(&linfo->lock);
- // Why (monty): I don't understand this comment
- // no big deal if we just started reading the log
- // nothing to adjust
+ /* index file offset can be less that purge offset
+ only if we just started reading the index file. In that case
+ we have nothing to adjust
+ */
if (linfo->index_file_offset < purge_offset)
linfo->fatal = (linfo->index_file_offset != 0);
else
@@ -935,16 +935,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
linfo.index_file_offset = 0;
- /*
- WARNING: POSSIBLE BUG:
- Sasha, you are setting an uninitialized linfo into
- thd->current_linfo.
- What will happen if some other thread calls log_in_use() or
- adjust_linfo_offsets() after the next instruction as linfo may
- contain anything ?
- */
- thd->current_linfo = &linfo;
search_file_name[0] = 0;
if (mysql_bin_log.find_first_log(&linfo, search_file_name))
@@ -952,6 +943,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
strmov(errmsg,"Could not find first log");
return 1;
}
+ thd->current_linfo = &linfo;
bzero((char*) &log,sizeof(log));
log_lock = mysql_bin_log.get_log_lock();