Skip to content

Commit 68f8c9a

Browse files
Fix Rows_query event when applying multi-packet queries
Summary: THD maintains the length of the current query in a multi-query, we should use that to extract only the current query to log in Rows_query event Also removed unwanted special handling of Rows_query event handling metadata, it's not a special event anymore. Squash with D7002217 Reviewed By: yashtc Differential Revision: D9003508 fbshipit-source-id: e13ff7f
1 parent 566b7f0 commit 68f8c9a

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

client/mysqlbinlog.cc

-7
Original file line numberDiff line numberDiff line change
@@ -1536,13 +1536,6 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
15361536
}
15371537
}
15381538
case ROWS_QUERY_LOG_EVENT:
1539-
// case: if events contains trx meta data print it else fall through
1540-
// like a normal rows query event
1541-
if (((Rows_query_log_event*) ev)->has_trx_meta_data())
1542-
{
1543-
ev->print(result_file, print_event_info);
1544-
break;
1545-
}
15461539
case WRITE_ROWS_EVENT:
15471540
case DELETE_ROWS_EVENT:
15481541
case UPDATE_ROWS_EVENT:

sql/binlog.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -8586,7 +8586,7 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional,
85868586
std::string query;
85878587
if (opt_binlog_trx_meta_data)
85888588
query.append(gen_trx_metadata());
8589-
query.append(this->query());
8589+
query.append(this->query(), this->query_length());
85908590

85918591
/* Write the Rows_query_log_event into binlog before the table map */
85928592
Rows_query_log_event rows_query_ev(this, query.c_str(), query.length());

0 commit comments

Comments
 (0)