Skip to content

Commit

Permalink
Remove unflushed events warning when trx metadata is enabled on SBR
Browse files Browse the repository at this point in the history
Summary:
mysqlbinlog expects rows_query event only in RBR. It prints an
unflushed event warning when it parses a transaction which has rows_query but
not a rows events with STMT_END_F flag set. Since there is no direct way to
tell the binlog format in mysqlbinlog, we'll just forgo the warning for
rows_event which contain metadata.

Squash with D9003508

Reviewed By: yashtc

Differential Revision: D9074409

fbshipit-source-id: 363fc8e
  • Loading branch information
abhinav04sharma authored and facebook-github-bot committed Jul 31, 2018
1 parent 990fd0f commit 89e1c03
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,15 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
else if (!opt_skip_rows_query || ev_type != ROWS_QUERY_LOG_EVENT)
ev->print(result_file, print_event_info);

print_event_info->have_unflushed_events= TRUE;
// case: we can have rows_query event containing trx metadata in SBR, to
// avoid unflushed event warning we'll skip setting this flag when the
// rows_query event contains trx metadata
if (!(ev_type == ROWS_QUERY_LOG_EVENT &&
static_cast<Rows_query_log_event*>(ev)->has_trx_meta_data()))
{
print_event_info->have_unflushed_events= TRUE;
}

/* Flush head and body cache to result_file */
if (stmt_end)
{
Expand Down

0 comments on commit 89e1c03

Please sign in to comment.