diff options
author | unknown <lars/lthalmann@mysql.com/dl145j.mysql.com> | 2007-01-12 12:22:54 +0100 |
---|---|---|
committer | unknown <lars/lthalmann@mysql.com/dl145j.mysql.com> | 2007-01-12 12:22:54 +0100 |
commit | ecc3a61944047d9acb931dde1fd1bd8df25124a1 (patch) | |
tree | 4362dc70674fff9e565390211eb5c37f797ee8d2 /client | |
parent | 50361d9a44ddce3d0253feba9c658a17b2b0a517 (diff) | |
parent | 34a723988edf89da9d543ee90f9472b1bc6fc3de (diff) | |
download | mariadb-git-ecc3a61944047d9acb931dde1fd1bd8df25124a1.tar.gz |
Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
client/mysqlbinlog.cc:
Auto merged
client/mysqldump.c:
Auto merged
include/my_pthread.h:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysys/my_thr_init.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/log_event.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_locale.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqlbinlog.cc | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index d4887f8c762..3949ae8a632 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -93,8 +93,10 @@ static bool stop_passed= 0; */ Format_description_log_event* description_event; -static int dump_local_log_entries(const char* logname); -static int dump_remote_log_entries(const char* logname); +static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname); +static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname); static int dump_log_entries(const char* logname); static int dump_remote_file(NET* net, const char* fname); static void die(const char* fmt, ...); @@ -949,8 +951,22 @@ static MYSQL* safe_connect() static int dump_log_entries(const char* logname) { - return (remote_opt ? dump_remote_log_entries(logname) : - dump_local_log_entries(logname)); + int rc; + PRINT_EVENT_INFO print_event_info; + /* + Set safe delimiter, to dump things + like CREATE PROCEDURE safely + */ + fprintf(result_file, "DELIMITER /*!*/;\n"); + strcpy(print_event_info.delimiter, "/*!*/;"); + + rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) : + dump_local_log_entries(&print_event_info, logname)); + + /* Set delimiter back to semicolon */ + fprintf(result_file, "DELIMITER ;\n"); + strcpy(print_event_info.delimiter, ";"); + return rc; } @@ -1015,11 +1031,11 @@ static int check_master_version(MYSQL* mysql, } -static int dump_remote_log_entries(const char* logname) +static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname) { char buf[128]; - PRINT_EVENT_INFO print_event_info; ulong len; uint logname_len; NET* net; @@ -1142,7 +1158,7 @@ could be out of memory"); len= 1; // fake Rotate, so don't increment old_off } } - if ((error= process_event(&print_event_info, ev, old_off))) + if ((error= process_event(print_event_info, ev, old_off))) { error= ((error < 0) ? 0 : 1); goto err; @@ -1161,7 +1177,7 @@ could be out of memory"); goto err; } - if ((error= process_event(&print_event_info, ev, old_off))) + if ((error= process_event(print_event_info, ev, old_off))) { my_close(file,MYF(MY_WME)); error= ((error < 0) ? 0 : 1); @@ -1287,11 +1303,11 @@ at offset %lu ; this could be a log format error or read error", } -static int dump_local_log_entries(const char* logname) +static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info, + const char* logname) { File fd = -1; IO_CACHE cache,*file= &cache; - PRINT_EVENT_INFO print_event_info; byte tmp_buff[BIN_LOG_HEADER_SIZE]; int error= 0; @@ -1363,7 +1379,7 @@ static int dump_local_log_entries(const char* logname) // file->error == 0 means EOF, that's OK, we break in this case break; } - if ((error= process_event(&print_event_info, ev, old_off))) + if ((error= process_event(print_event_info, ev, old_off))) { if (error < 0) error= 0; |