diff options
author | dlenev@mysql.com <> | 2003-09-19 20:34:57 +0400 |
---|---|---|
committer | dlenev@mysql.com <> | 2003-09-19 20:34:57 +0400 |
commit | 3c55dbe3dbc576dfb2e70346be3d72b3ffc53a30 (patch) | |
tree | 94d23272768b936ee38da1a580bec74cfa61975d /client/mysqlbinlog.cc | |
parent | d623fc83b1bc27c4dec55514ccd2c28cea08b8bf (diff) | |
parent | 69aed374a536dff9ba0ab37363556165f9a6c27d (diff) | |
download | mariadb-git-3c55dbe3dbc576dfb2e70346be3d72b3ffc53a30.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/dlenev/src/mysql-4.0-bg-1340
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r-- | client/mysqlbinlog.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index e301d40b5b8..43872dd718a 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -185,6 +185,8 @@ public: } Create_file_log_event *grab_event(uint file_id) { + if (file_id >= file_names.elements) + return 0; Create_file_log_event **ptr= (Create_file_log_event**)file_names.buffer + file_id; Create_file_log_event *res= *ptr; @@ -198,8 +200,14 @@ public: } void process(Append_block_log_event *ae) { - if (ae->file_id >= file_names.elements) - { + Create_file_log_event* ce= 0; + + if (ae->file_id < file_names.elements) + ce= *((Create_file_log_event**)file_names.buffer + ae->file_id); + + if (ce) + append_to_file(ce->fname,O_APPEND|O_BINARY|O_WRONLY,ae->block,ae->block_len); + else /* There is no Create_file event (a bad binlog or a big --position). Assuming it's a big --position, we just do nothing and @@ -207,11 +215,6 @@ public: */ fprintf(stderr,"Warning: ignoring Append_block as there is no \ Create_file event for file_id: %u\n",ae->file_id); - return; - } - Create_file_log_event* ce= - *((Create_file_log_event**)file_names.buffer + ae->file_id); - append_to_file(ce->fname,O_APPEND|O_BINARY|O_WRONLY,ae->block,ae->block_len); } }; |