summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkatesh Duggirala <venkatesh.duggirala@oracle.com>2013-04-25 11:56:26 +0530
committerVenkatesh Duggirala <venkatesh.duggirala@oracle.com>2013-04-25 11:56:26 +0530
commit2557f2c4ca43b61c6f6653e41fc9e4bb68f7618a (patch)
treeb83b128cd6de29fdba38ea5226e307350a883bd0
parent4297893ccc68f34164b55bd824fb0474476722fa (diff)
downloadmariadb-git-2557f2c4ca43b61c6f6653e41fc9e4bb68f7618a.tar.gz
BUG#16698172-CANNOT DO POINT-IN-TIME RECOVERY FOR
SINGLE DATABASE; MYSQLBINLOG Problem: If last subevent inside a RBR event is skipped while replaying a binary log using mysqlbinlog with --database=... option, generated output is missing end marker('/*!*/;) for that RBR event. Thence causing syntax error while replaying the generated output. Fix: Append end marker ('/*!*/;) if the last subevent is getting skipped. Append end marker if the last subevent is getting skipped. client/mysqlbinlog.cc: Append end marker if the last subevent is getting skipped.
-rw-r--r--client/mysqlbinlog.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index c0c502516e4..60c9e4a0b40 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -969,7 +969,11 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
/*
end of statement check:
i) destroy/free ignored maps
- ii) if skip event, flush cache now
+ ii) if skip event
+ a) since we are skipping the last event,
+ append END-MARKER(') to body cache (if required)
+
+ b) flush cache now
*/
if (stmt_end)
{
@@ -991,6 +995,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
if (skip_event)
{
+ // append END-MARKER(') with delimiter
+ IO_CACHE *const body_cache= &print_event_info->body_cache;
+ if (my_b_tell(body_cache))
+ my_b_printf(body_cache, "'%s\n", print_event_info->delimiter);
+
+ // flush cache
if ((copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, result_file) ||
copy_event_cache_to_file_and_reinit(&print_event_info->body_cache, result_file)))
goto err;