mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge stella.local:/home2/mydev/mysql-5.1-amain
into stella.local:/home2/mydev/mysql-5.1-axmrg mysql-test/r/ctype_big5.result: Auto merged mysql-test/r/ctype_euckr.result: Auto merged mysql-test/r/ctype_gb2312.result: Auto merged mysql-test/r/ctype_gbk.result: Auto merged mysql-test/r/ctype_uca.result: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/suite/binlog/r/binlog_row_ctype_cp932.result: Auto merged mysql-test/suite/binlog/r/binlog_stm_ctype_cp932.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/rpl_rli.cc: Auto merged sql/slave.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/lib/mtr_report.pl: SCCS merged
This commit is contained in:
63
sql/slave.cc
63
sql/slave.cc
@ -2019,28 +2019,6 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
|
||||
wait for something for example inside of next_event().
|
||||
*/
|
||||
pthread_mutex_lock(&rli->data_lock);
|
||||
/*
|
||||
This tests if the position of the end of the last previous executed event
|
||||
hits the UNTIL barrier.
|
||||
We would prefer to test if the position of the start (or possibly) end of
|
||||
the to-be-read event hits the UNTIL barrier, this is different if there
|
||||
was an event ignored by the I/O thread just before (BUG#13861 to be
|
||||
fixed).
|
||||
*/
|
||||
if (rli->until_condition!=Relay_log_info::UNTIL_NONE &&
|
||||
rli->is_until_satisfied())
|
||||
{
|
||||
char buf[22];
|
||||
sql_print_information("Slave SQL thread stopped because it reached its"
|
||||
" UNTIL position %s", llstr(rli->until_pos(), buf));
|
||||
/*
|
||||
Setting abort_slave flag because we do not want additional message about
|
||||
error in query execution to be printed.
|
||||
*/
|
||||
rli->abort_slave= 1;
|
||||
pthread_mutex_unlock(&rli->data_lock);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
Log_event * ev = next_event(rli);
|
||||
|
||||
@ -2054,7 +2032,30 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli)
|
||||
}
|
||||
if (ev)
|
||||
{
|
||||
int exec_res= apply_event_and_update_pos(ev, thd, rli, TRUE);
|
||||
int exec_res;
|
||||
|
||||
/*
|
||||
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 &&
|
||||
rli->is_until_satisfied((rli->is_in_group() || !ev->log_pos) ?
|
||||
rli->group_master_log_pos :
|
||||
ev->log_pos - ev->data_written))
|
||||
{
|
||||
char buf[22];
|
||||
sql_print_information("Slave SQL thread stopped because it reached its"
|
||||
" UNTIL position %s", llstr(rli->until_pos(), buf));
|
||||
/*
|
||||
Setting abort_slave flag because we do not want additional message about
|
||||
error in query execution to be printed.
|
||||
*/
|
||||
rli->abort_slave= 1;
|
||||
pthread_mutex_unlock(&rli->data_lock);
|
||||
delete ev;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
exec_res= apply_event_and_update_pos(ev, thd, rli, TRUE);
|
||||
|
||||
/*
|
||||
Format_description_log_event should not be deleted because it will be
|
||||
@ -2690,6 +2691,22 @@ Slave SQL thread aborted. Can't execute init_slave query");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
First check until condition - probably there is nothing to execute. We
|
||||
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 &&
|
||||
rli->is_until_satisfied(rli->group_master_log_pos))
|
||||
{
|
||||
char buf[22];
|
||||
sql_print_information("Slave SQL thread stopped because it reached its"
|
||||
" UNTIL position %s", llstr(rli->until_pos(), buf));
|
||||
pthread_mutex_unlock(&rli->data_lock);
|
||||
goto err;
|
||||
}
|
||||
pthread_mutex_unlock(&rli->data_lock);
|
||||
|
||||
/* Read queries from the IO/THREAD until this thread is killed */
|
||||
|
||||
while (!sql_slave_killed(thd,rli))
|
||||
|
Reference in New Issue
Block a user