summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
authorjani@ua141d10.elisa.omakaista.fi <>2007-03-29 17:27:42 +0300
committerjani@ua141d10.elisa.omakaista.fi <>2007-03-29 17:27:42 +0300
commit1c7beca65eba89f0bbd620e8fbdfaae28c0e8c97 (patch)
tree94d5a320e9c08b8f33e5b1e51f794fe67b8c9cc7 /client/mysqlbinlog.cc
parent3bd0494eb9f465e442694819ba66ae87287ce9c5 (diff)
parent3c3b0391f89fe6deb30766ec8214fe83f5f64cef (diff)
downloadmariadb-git-1c7beca65eba89f0bbd620e8fbdfaae28c0e8c97.tar.gz
Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0-marvel
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r--client/mysqlbinlog.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 6a61e010d6e..9afe8f6872c 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1101,7 +1101,7 @@ static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
uint logname_len;
NET* net;
int error= 0;
- my_off_t old_off= start_position_mot;
+ my_off_t old_off= min(start_position_mot, BIN_LOG_HEADER_SIZE);
char fname[FN_REFLEN+1];
DBUG_ENTER("dump_remote_log_entries");
@@ -1164,7 +1164,7 @@ could be out of memory");
}
if (len < 8 && net->read_pos[0] == 254)
break; // end of data
- DBUG_PRINT("info",( "len: %lu, net->read_pos[5]: %d\n",
+ DBUG_PRINT("info",( "len: %lu net->read_pos[5]: %d\n",
len, net->read_pos[5]));
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
len - 1, &error_msg,
@@ -1253,10 +1253,17 @@ could be out of memory");
}
}
/*
- Let's adjust offset for remote log as for local log to produce
- similar text.
+ Let's adjust offset for remote log as for local log to produce
+ similar text and to have --stop-position to work identically.
+
+ Exception - the server sends Format_description_log_event
+ in the beginning of the dump, and only after it the event from
+ start_position. Let the old_off reflect it.
*/
- old_off+= len-1;
+ if (old_off < start_position_mot)
+ old_off= start_position_mot;
+ else
+ old_off+= len-1;
}
err: