summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@oracle.com>2011-01-31 10:11:01 +0000
committerAlfranio Correia <alfranio.correia@oracle.com>2011-01-31 10:11:01 +0000
commit54c58cea3bdc0733ffe7ba1dd93632ac6b78e403 (patch)
treee87cb89ef59d837be1d5682c3a5c67f7f3073c39 /sql
parentee36bd7f468403489eca2a96fdafce787c30c204 (diff)
parent235e10d987222b8cc42e1f3a9a79834912d45026 (diff)
downloadmariadb-git-54c58cea3bdc0733ffe7ba1dd93632ac6b78e403.tar.gz
merge mysql-5.1 (local) --> mysql-5.1
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_repl.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 8c769ce6acf..2a1efab13a9 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -545,8 +545,10 @@ impossible position";
while (!net->error && net->vio != 0 && !thd->killed)
{
+ my_off_t prev_pos= pos;
while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
{
+ prev_pos= my_b_tell(&log);
#ifndef DBUG_OFF
if (max_binlog_dump_events && !left_events--)
{
@@ -613,8 +615,13 @@ impossible position";
here we were reading binlog that was not closed properly (as a result
of a crash ?). treat any corruption as EOF
*/
- if (binlog_can_be_corrupted && error != LOG_READ_MEM)
+ if (binlog_can_be_corrupted &&
+ error != LOG_READ_MEM && error != LOG_READ_EOF)
+ {
+ my_b_seek(&log, prev_pos);
error=LOG_READ_EOF;
+ }
+
/*
TODO: now that we are logging the offset, check to make sure
the recorded offset and the actual match.