summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
authorRohit Kalhans <rohit.kalhans@oracle.com>2012-05-29 12:21:17 +0530
committerRohit Kalhans <rohit.kalhans@oracle.com>2012-05-29 12:21:17 +0530
commit484a79415b7624cd1abb7461cb353925a0c075b7 (patch)
tree83f60814b3cdb2e45d040716ff335601b826ccb3 /client/mysqlbinlog.cc
parentb2c3acc987193775d392e763c8b9eef3da7c65a8 (diff)
parentd8b2d4a0694156848db0862a230d248653f8ebe5 (diff)
downloadmariadb-git-484a79415b7624cd1abb7461cb353925a0c075b7.tar.gz
upmerge from mysql-5.1 branch -> mysql-5.5 branch
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r--client/mysqlbinlog.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index ecebde461f9..f2754fbd012 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -698,6 +698,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
@@ -761,6 +762,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;
case CREATE_FILE_EVENT:
@@ -812,6 +815,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;
@@ -820,6 +825,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);
/*
@@ -849,6 +856,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
@@ -878,6 +887,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;
@@ -988,6 +999,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;
}
}
@@ -2020,7 +2033,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;
}