From f8e9e925322bf11eabc58e3ccd13b963fb98753e Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Tue, 14 Sep 2021 19:34:16 +0300 Subject: Standalone GTID group does not end with any of Xid, Commit or ROLLBACK. --- client/mysqlbinlog.cc | 4 +++- sql/log_event.h | 2 ++ sql/log_event_client.cc | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index b31439c2d66..a766e46b79f 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1042,6 +1042,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, gtid.seq_no= gle->seq_no; if (!domain_gtid_filter->exclude(>id)) ev->activate_current_event_group(); + ev->last_gtid_standalone= + (gle->flags2 & Gtid_log_event::FL_STANDALONE) ? true : false; } /* @@ -3447,4 +3449,4 @@ struct encryption_service_st encryption_handler= #include "sql_list.cc" #include "rpl_filter.cc" #include "compat56.cc" -#include "rpl_gtid.cc" \ No newline at end of file +#include "rpl_gtid.cc" diff --git a/sql/log_event.h b/sql/log_event.h index 520209d8fde..abd9ddc89e7 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1311,6 +1311,8 @@ public: */ static my_bool m_is_event_group_filtering_enabled; + static my_bool last_gtid_standalone; // gtid type of last seen gtid + /* Notify that all events part of the current group should be printed */ diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc index 0fc2fc3f17e..ba51631c447 100644 --- a/sql/log_event_client.cc +++ b/sql/log_event_client.cc @@ -326,6 +326,7 @@ static inline bool is_enum_or_set_type(uint type) { my_bool Log_event::m_is_event_group_active= FALSE; my_bool Log_event::m_is_event_group_filtering_enabled= FALSE; +my_bool Log_event::last_gtid_standalone= FALSE; /* Log_event::print_header() @@ -2017,7 +2018,7 @@ bool Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info) This marks the end of an event group. All events prior to this have been printed, need to reset the tracking for future event groups */ - if (is_commit()) + if (is_commit() || is_rollback() || last_gtid_standalone) deactivate_current_event_group(); #endif -- cgit v1.2.1