summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-08-22 16:45:25 +0200
committerSergei Golubchik <sergii@pisem.net>2012-08-22 16:45:25 +0200
commitf72a7659976089dc6f727bb31e8a91306199cf57 (patch)
tree0199cd1bf1c16b01b358ab88e5dce5b038349872 /client/mysqlbinlog.cc
parented06ba3492d55c9e9dde231b55352f854e5e4b50 (diff)
parent1fd8150a5b5e3f56aa3c253225929a07ee9a4026 (diff)
downloadmariadb-git-f72a7659976089dc6f727bb31e8a91306199cf57.tar.gz
5.2 merge.
two tests still fail: main.innodb_icp and main.range_vs_index_merge_innodb call records_in_range() with both range ends being open (which triggers an assert)
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r--client/mysqlbinlog.cc38
1 files changed, 34 insertions, 4 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index f562f30313c..8daa276de52 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -1,5 +1,5 @@
/*
- Copyright (c) 2000, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2000, 2012, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -807,6 +807,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
DBUG_ENTER("process_event");
print_event_info->short_form= short_form;
Exit_status retval= OK_CONTINUE;
+ IO_CACHE *const head= &print_event_info->head_cache;
/*
Format events are not concerned by --offset and such, we always need to
@@ -883,6 +884,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
else
ev->print(result_file, print_event_info);
+ if (head->error == -1)
+ goto err;
break;
}
@@ -912,8 +915,11 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
goto end;
}
else
+ {
ce->print(result_file, print_event_info, TRUE);
-
+ if (head->error == -1)
+ goto err;
+ }
// If this binlog is not 3.23 ; why this test??
if (glob_description_event->binlog_version >= 3)
{
@@ -935,6 +941,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
output of Append_block_log_event::print is only a comment.
*/
ev->print(result_file, print_event_info);
+ if (head->error == -1)
+ goto err;
if ((retval= load_processor.process((Append_block_log_event*) ev)) !=
OK_CONTINUE)
goto end;
@@ -943,6 +951,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case EXEC_LOAD_EVENT:
{
ev->print(result_file, print_event_info);
+ if (head->error == -1)
+ goto err;
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
/*
@@ -960,6 +970,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
ce->print(result_file, print_event_info, TRUE);
my_free((char*)ce->fname,MYF(MY_WME));
delete ce;
+ if (head->error == -1)
+ goto err;
}
else
warning("Ignoring Execute_load_log_event as there is no "
@@ -972,6 +984,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print_event_info->common_header_len=
glob_description_event->common_header_len;
ev->print(result_file, print_event_info);
+ if (head->error == -1)
+ goto err;
if (!remote_opt)
ev->free_temp_buf(); // free memory allocated in dump_local_log_entries
else
@@ -995,6 +1009,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
break;
case BEGIN_LOAD_QUERY_EVENT:
ev->print(result_file, print_event_info);
+ if (head->error == -1)
+ goto err;
if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) !=
OK_CONTINUE)
goto end;
@@ -1011,6 +1027,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{
convert_path_to_forward_slashes(fname);
exlq->print(result_file, print_event_info, fname);
+ if (head->error == -1)
+ {
+ if (fname)
+ my_free(fname, MYF(MY_WME));
+ goto err;
+ }
}
else
warning("Ignoring Execute_load_query since there is no "
@@ -1140,6 +1162,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
default:
ev->print(result_file, print_event_info);
+ if (head->error == -1)
+ goto err;
}
}
@@ -1304,7 +1328,7 @@ static struct my_option my_long_options[] =
"Stop reading the binlog at position N. Applies to the last binlog "
"passed on the command line.",
&stop_position, &stop_position, 0, GET_ULL,
- REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
+ REQUIRED_ARG, (longlong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \
@@ -2275,7 +2299,13 @@ err:
end:
if (fd >= 0)
my_close(fd, MYF(MY_WME));
- end_io_cache(file);
+ /*
+ Since the end_io_cache() writes to the
+ file errors may happen.
+ */
+ if (end_io_cache(file))
+ retval= ERROR_STOP;
+
return retval;
}