@@ -698,6 +698,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
698
698
DBUG_ENTER (" process_event" );
699
699
print_event_info->short_form = short_form;
700
700
Exit_status retval= OK_CONTINUE;
701
+ IO_CACHE *const head= &print_event_info->head_cache ;
701
702
702
703
/*
703
704
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,
761
762
}
762
763
else
763
764
ev->print (result_file, print_event_info);
765
+ if (head->error == -1 )
766
+ goto err;
764
767
break ;
765
768
766
769
case CREATE_FILE_EVENT:
@@ -812,6 +815,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
812
815
output of Append_block_log_event::print is only a comment.
813
816
*/
814
817
ev->print (result_file, print_event_info);
818
+ if (head->error == -1 )
819
+ goto err;
815
820
if ((retval= load_processor.process ((Append_block_log_event*) ev)) !=
816
821
OK_CONTINUE)
817
822
goto end;
@@ -820,6 +825,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
820
825
case EXEC_LOAD_EVENT:
821
826
{
822
827
ev->print (result_file, print_event_info);
828
+ if (head->error == -1 )
829
+ goto err;
823
830
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
824
831
Create_file_log_event *ce= load_processor.grab_event (exv->file_id );
825
832
/*
@@ -849,6 +856,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
849
856
print_event_info->common_header_len =
850
857
glob_description_event->common_header_len ;
851
858
ev->print (result_file, print_event_info);
859
+ if (head->error == -1 )
860
+ goto err;
852
861
if (!remote_opt)
853
862
{
854
863
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,
878
887
break ;
879
888
case BEGIN_LOAD_QUERY_EVENT:
880
889
ev->print (result_file, print_event_info);
890
+ if (head->error == -1 )
891
+ goto err;
881
892
if ((retval= load_processor.process ((Begin_load_query_log_event*) ev)) !=
882
893
OK_CONTINUE)
883
894
goto end;
@@ -988,6 +999,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
988
999
}
989
1000
default :
990
1001
ev->print (result_file, print_event_info);
1002
+ if (head->error == -1 )
1003
+ goto err;
991
1004
}
992
1005
}
993
1006
@@ -2020,7 +2033,13 @@ static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
2020
2033
end:
2021
2034
if (fd >= 0 )
2022
2035
my_close (fd, MYF (MY_WME));
2023
- end_io_cache (file);
2036
+ /*
2037
+ Since the end_io_cache() writes to the
2038
+ file errors may happen.
2039
+ */
2040
+ if (end_io_cache (file))
2041
+ retval= ERROR_STOP;
2042
+
2024
2043
return retval;
2025
2044
}
2026
2045
0 commit comments