diff options
author | unknown <serg@sergbook.mysql.com> | 2007-03-22 20:55:59 +0200 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2007-03-22 20:55:59 +0200 |
commit | e2e06e3abe52aa1ec7432522d82ec1d0b2b1959e (patch) | |
tree | ad24e5cf951ba37924e1fa9ccc35eecb53307be7 /client/mysqlbinlog.cc | |
parent | eac3e9572a4060f7d31fef52a34c2304134caa7c (diff) | |
download | mariadb-git-e2e06e3abe52aa1ec7432522d82ec1d0b2b1959e.tar.gz |
Bug#27171 mysqlbinlog produces different output depends from option -R
Server starts any binlog dump from Format_description_log_event,
this shifted all offset calculations in mysqlbinlog and made it
to stop the dump earlier than --stop-position. Now mysqlbinlog
takes Format_description_log_event into account
mysql-test/r/mysqlbinlog2.result:
Bug#27171 mysqlbinlog produces different output depends from option -R
mysql-test/t/mysqlbinlog2.test:
Bug#27171 mysqlbinlog produces different output depends from option -R
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r-- | client/mysqlbinlog.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 7489cdb334c..d8ea3d5f255 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1040,7 +1040,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"); @@ -1192,10 +1192,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: |