summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/june.mysql.com>2008-02-27 21:46:06 +0400
committerunknown <svoj@mysql.com/june.mysql.com>2008-02-27 21:46:06 +0400
commit83bcd5dfab83948353b2f30bfe497f0a92d31977 (patch)
treef13c97ab1c6bbf24dc3fdd2734cd5b7fc1157126 /sql
parenteec647badb68d4f5a2a73471de6ffbdbfb13b0b8 (diff)
downloadmariadb-git-83bcd5dfab83948353b2f30bfe497f0a92d31977.tar.gz
BUG#13861 - START SLAVE UNTIL may stop 1 evnt too late if
log-slave-updates and circul repl After merge fixes. mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt: Rename: mysql-test/t/rpl_dual_pos_advance-slave.opt -> mysql-test/suite/rpl/t/rpl_dual_pos_advance-slave.opt mysql-test/include/wait_for_slave_sql_to_stop.inc: Do not change connection if it was requested by caller (needed for circular replication tests). mysql-test/suite/rpl/t/rpl_dual_pos_advance.test: Let include/wait_for_slave_sql_to_stop.inc know that we do not want to change connection to slave. sql/rpl_rli.cc: After merge fix. sql/rpl_rli.h: After merge fix. sql/slave.cc: After merge fix.
Diffstat (limited to 'sql')
-rw-r--r--sql/rpl_rli.cc9
-rw-r--r--sql/rpl_rli.h2
-rw-r--r--sql/slave.cc4
3 files changed, 10 insertions, 5 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 03f790b934f..96e6b194916 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -955,6 +955,11 @@ err:
Check if condition stated in UNTIL clause of START SLAVE is reached.
SYNOPSYS
Relay_log_info::is_until_satisfied()
+ master_beg_pos position of the beginning of to be executed event
+ (not log_pos member of the event that points to the
+ beginning of the following event)
+
+
DESCRIPTION
Checks if UNTIL condition is reached. Uses caching result of last
comparison of current log file name and target log file name. So cached
@@ -979,7 +984,7 @@ err:
false - condition not met
*/
-bool Relay_log_info::is_until_satisfied()
+bool Relay_log_info::is_until_satisfied(my_off_t master_beg_pos)
{
const char *log_name;
ulonglong log_pos;
@@ -990,7 +995,7 @@ bool Relay_log_info::is_until_satisfied()
if (until_condition == UNTIL_MASTER_POS)
{
log_name= group_master_log_name;
- log_pos= group_master_log_pos;
+ log_pos= master_beg_pos;
}
else
{ /* until_condition == UNTIL_RELAY_POS */
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index 36daffae1af..e13ea93842c 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -296,7 +296,7 @@ public:
void close_temporary_tables();
/* Check if UNTIL condition is satisfied. See slave.cc for more. */
- bool is_until_satisfied();
+ bool is_until_satisfied(my_off_t master_beg_pos);
inline ulonglong until_pos()
{
return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos :
diff --git a/sql/slave.cc b/sql/slave.cc
index 8bd28c903ae..b8d1fdfbb6b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1990,7 +1990,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
This tests if the position of the beginning of the current event
hits the UNTIL barrier.
*/
- if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE &&
+ if (rli->until_condition != Relay_log_info::UNTIL_NONE &&
rli->is_until_satisfied((rli->is_in_group() || !ev->log_pos) ?
rli->group_master_log_pos :
ev->log_pos - ev->data_written))
@@ -2648,7 +2648,7 @@ Slave SQL thread aborted. Can't execute init_slave query");
do not want to wait for next event in this case.
*/
pthread_mutex_lock(&rli->data_lock);
- if (rli->until_condition != RELAY_LOG_INFO::UNTIL_NONE &&
+ if (rli->until_condition != Relay_log_info::UNTIL_NONE &&
rli->is_until_satisfied(rli->group_master_log_pos))
{
char buf[22];