summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
authorunknown <jani@ua141d10.elisa.omakaista.fi>2007-04-03 14:51:32 +0300
committerunknown <jani@ua141d10.elisa.omakaista.fi>2007-04-03 14:51:32 +0300
commitfbd929f802a50c9689f6dfa1c002fd7e2a06f77e (patch)
tree03a5b2578f04ebe1851f028ee0c732ef2a446550 /client/mysqlbinlog.cc
parente552b08fcd1103a0203612ad8997e1df731f5732 (diff)
parente57c8007a4e2c7d1f8bda44b0af6599126673ef4 (diff)
downloadmariadb-git-fbd929f802a50c9689f6dfa1c002fd7e2a06f77e.tar.gz
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marvel
into ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-marvel mysys/my_pread.c: Auto merged mysys/thr_alarm.c: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged storage/heap/hp_write.c: Auto merged mysql-test/t/mysqlbinlog2.test: SCCS merged client/mysql.cc: Auto merged client/mysqlbinlog.cc: Auto merged sql/event_db_repository.cc: Auto merged sql/item.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged
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 f1252bd262c..e9ce861ab29 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1099,7 +1099,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");
@@ -1162,7 +1162,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,
@@ -1251,10 +1251,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: