diff options
author | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2007-04-13 10:25:33 +0300 |
---|---|---|
committer | unknown <jani@a88-113-38-195.elisa-laajakaista.fi> | 2007-04-13 10:25:33 +0300 |
commit | e628ba73e37221a4ab433acdd3004b5c627b0c71 (patch) | |
tree | ddaa7e5c8b1062849706364dc349e5d30bef220c /client/mysqlbinlog.cc | |
parent | 830803a23b017530a76f176d635d83c1adc588e8 (diff) | |
parent | f036fbcd45ff6481a910d4fa6ebf86b73bb883c7 (diff) | |
download | mariadb-git-e628ba73e37221a4ab433acdd3004b5c627b0c71.tar.gz |
Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/new/mysql-5.0-marvel
into a88-113-38-195.elisa-laajakaista.fi:/home/my/new/mysql-5.1-marvel
client/mysql.cc:
Auto merged
client/mysql_upgrade.c:
Auto merged
client/mysqlbinlog.cc:
Auto merged
client/mysqldump.c:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/grant.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysys/my_malloc.c:
Auto merged
mysys/my_static.c:
Auto merged
mysys/safemalloc.c:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
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_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql-common/client.c:
Auto merged
sql-common/my_time.c:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.cc:
Auto merged
storage/archive/ha_archive.cc:
Auto merged
storage/heap/hp_write.c:
Auto merged
storage/innobase/handler/ha_innodb.cc:
Auto merged
storage/ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
mysql-test/r/grant.result:
Merged from 5.0
sql/sql_db.cc:
Merged from 5.0
sql/sql_parse.cc:
Merged from 5.0
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r-- | client/mysqlbinlog.cc | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index e9ce861ab29..06ae20da8cf 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= min(start_position_mot, BIN_LOG_HEADER_SIZE); + my_off_t old_off= start_position_mot; char fname[FN_REFLEN+1]; DBUG_ENTER("dump_remote_log_entries"); @@ -1217,6 +1217,18 @@ could be out of memory"); len= 1; // fake Rotate, so don't increment old_off } } + else if (type == FORMAT_DESCRIPTION_EVENT) + { + /* + This could be an fake Format_description_log_event that server + (5.0+) automatically sends to a slave on connect, before sending + a first event at the requested position. If this is the case, + don't increment old_off. Real Format_description_log_event always + starts from BIN_LOG_HEADER_SIZE position. + */ + if (old_off != BIN_LOG_HEADER_SIZE) + len= 1; // fake event, don't increment old_off + } if ((error= process_event(print_event_info, ev, old_off))) { error= ((error < 0) ? 0 : 1); @@ -1229,16 +1241,16 @@ could be out of memory"); const char *old_fname= le->fname; uint old_len= le->fname_len; File file; - + if ((file= load_processor.prepare_new_file_for_old_format(le,fname)) < 0) { error= 1; goto err; } - + if ((error= process_event(print_event_info, ev, old_off))) { - my_close(file,MYF(MY_WME)); + my_close(file,MYF(MY_WME)); error= ((error < 0) ? 0 : 1); goto err; } @@ -1253,15 +1265,8 @@ could be out of memory"); /* 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. */ - if (old_off < start_position_mot) - old_off= start_position_mot; - else - old_off+= len-1; + old_off+= len-1; } err: |