diff options
author | unknown <monty@bitch.mysql.fi> | 2002-06-08 21:02:01 +0300 |
---|---|---|
committer | unknown <monty@bitch.mysql.fi> | 2002-06-08 21:02:01 +0300 |
commit | 770aa9f2d10ac3b10d5e80c88cc154c3fa3cf81b (patch) | |
tree | dd6fcd7f2120c05a87f087ac245b6ceed6597399 /sql/sql_repl.cc | |
parent | 330addff25cc339b83d366c27d3cb02e0581abca (diff) | |
download | mariadb-git-770aa9f2d10ac3b10d5e80c88cc154c3fa3cf81b.tar.gz |
Added a lot of DBUG_xxx statements to be able to find replication bug.
Fixed critical bug on 64 bit systems.
Cleanups
BUILD/compile-solaris-sparc-purify:
Added --debug option.
sql/log_event.cc:
Added DBUG_xxx statements.
Cleanup
sql/opt_range.h:
Dummy fix to remove warnings in purify
sql/repl_failsafe.cc:
Cleanup
sql/slave.cc:
Added DBUG statements to be able to find bugs.
Optimized code.
Fixed critical bug on 64 bit systems.
sql/sql_repl.cc:
Added DBUG_xx statements.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 415007b38fa..39c84090bb7 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -323,7 +323,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags) if (pos < 4) { - errmsg = "Client requested master to start repliction from \ + errmsg= "Client requested master to start replication from \ impossible position"; goto err; } @@ -691,7 +691,8 @@ int change_master(THD* thd, MASTER_INFO* mi) int error=0,restart_thread_mask; const char* errmsg=0; bool need_relay_log_purge=1; - + DBUG_ENTER("change_master"); + // kill slave thread lock_slave_threads(mi); init_thread_mask(&restart_thread_mask,mi,0 /*not inverse*/); @@ -702,7 +703,7 @@ int change_master(THD* thd, MASTER_INFO* mi) { send_error(&thd->net,error); unlock_slave_threads(mi); - return 1; + DBUG_RETURN(1); } thd->proc_info = "changing master"; LEX_MASTER_INFO* lex_mi = &thd->lex.mi; @@ -711,7 +712,7 @@ int change_master(THD* thd, MASTER_INFO* mi) { send_error(&thd->net, 0, "Could not initialize master info"); unlock_slave_threads(mi); - return 1; + DBUG_RETURN(1); } /* data lock not needed since we have already stopped the running threads, @@ -722,7 +723,7 @@ int change_master(THD* thd, MASTER_INFO* mi) { // if we change host or port, we must reset the postion mi->master_log_name[0] = 0; - mi->master_log_pos = 4; // skip magic number + mi->master_log_pos= BIN_LOG_HEADER_SIZE; mi->rli.pending = 0; } @@ -731,9 +732,10 @@ int change_master(THD* thd, MASTER_INFO* mi) sizeof(mi->master_log_name)); if (lex_mi->pos) { - mi->master_log_pos = lex_mi->pos; + mi->master_log_pos= lex_mi->pos; mi->rli.pending = 0; } + DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); if (lex_mi->host) strmake(mi->host, lex_mi->host, sizeof(mi->host)); @@ -769,7 +771,7 @@ int change_master(THD* thd, MASTER_INFO* mi) &errmsg)) { net_printf(&thd->net, 0, "Failed purging old relay logs: %s",errmsg); - return 1; + DBUG_RETURN(1); } } else @@ -783,11 +785,11 @@ int change_master(THD* thd, MASTER_INFO* mi) //Sasha: note that I had to change net_printf() to make this work net_printf(&thd->net,0,"Failed initializing relay log position: %s",msg); unlock_slave_threads(mi); - return 1; + DBUG_RETURN(1); } - } mi->rli.master_log_pos = mi->master_log_pos; + DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); strnmov(mi->rli.master_log_name,mi->master_log_name, sizeof(mi->rli.master_log_name)); if (!mi->rli.master_log_name[0]) // uninitialized case @@ -810,7 +812,7 @@ int change_master(THD* thd, MASTER_INFO* mi) send_error(&thd->net,error); else send_ok(&thd->net); - return 0; + DBUG_RETURN(0); } int reset_master(THD* thd) |