diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 3 | ||||
-rw-r--r-- | sql/rpl_parallel.cc | 4 | ||||
-rw-r--r-- | sql/rpl_rli.cc | 4 | ||||
-rw-r--r-- | sql/sql_repl.cc | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index a56bd1b560d..56b3343fe68 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9006,7 +9006,8 @@ int Xid_apply_log_event::do_apply_event(rpl_group_info *rgi) rpl_gtid gtid; /* - XID_EVENT works like a COMMIT statement. And it also updates the + An instance of this class such as XID_EVENT works like a COMMIT + statement. As well as XA_PREPARE_LOG_EVENT it also updates mysql.gtid_slave_pos table with the GTID of the current transaction. Therefore, it acts much like a normal SQL statement, so we need to do diff --git a/sql/rpl_parallel.cc b/sql/rpl_parallel.cc index dc5e3ff1fbf..91cf0428611 100644 --- a/sql/rpl_parallel.cc +++ b/sql/rpl_parallel.cc @@ -648,7 +648,7 @@ convert_kill_to_deadlock_error(rpl_group_info *rgi) static int is_group_ending(Log_event *ev, Log_event_type event_type) { - if (event_type == XID_EVENT) + if (event_type == XID_EVENT || event_type == XA_PREPARE_LOG_EVENT) return 1; if (event_type == QUERY_EVENT) // COMMIT/ROLLBACK are never compressed { @@ -2615,7 +2615,7 @@ rpl_parallel::do_event(rpl_group_info *serial_rgi, Log_event *ev, else { DBUG_ASSERT(rli->gtid_skip_flag == GTID_SKIP_TRANSACTION); - if (typ == XID_EVENT || + if (typ == XID_EVENT || typ == XA_PREPARE_LOG_EVENT || (typ == QUERY_EVENT && // COMMIT/ROLLBACK are never compressed (((Query_log_event *)ev)->is_commit() || ((Query_log_event *)ev)->is_rollback()))) diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 0d8a5ad490b..45dfedcd582 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -2234,10 +2234,10 @@ void rpl_group_info::cleanup_context(THD *thd, bool error) It could be done only after necessarily closing tables which dictates the following placement. */ - XID_STATE *xid_state= &thd->transaction.xid_state; - if (xid_state->is_explicit_XA()) + if (thd->transaction.xid_state.is_explicit_XA()) { xa_trans_force_rollback(thd); + attach_native_trx(thd); } thd->mdl_context.release_transactional_locks(); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index a058c366f60..3ea9a2b52e1 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1640,7 +1640,7 @@ is_until_reached(binlog_send_info *info, ulong *ev_offset, return false; break; case GTID_UNTIL_STOP_AFTER_TRANSACTION: - if (event_type != XID_EVENT && + if (event_type != XID_EVENT && event_type != XA_PREPARE_LOG_EVENT && (event_type != QUERY_EVENT || /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ !Query_log_event::peek_is_commit_rollback (info->packet->ptr()+*ev_offset, @@ -1875,7 +1875,7 @@ send_event_to_slave(binlog_send_info *info, Log_event_type event_type, info->gtid_skip_group= GTID_SKIP_NOT; return NULL; case GTID_SKIP_TRANSACTION: - if (event_type == XID_EVENT || + if (event_type == XID_EVENT || event_type == XA_PREPARE_LOG_EVENT || (event_type == QUERY_EVENT && /* QUERY_COMPRESSED_EVENT would never be commmit or rollback */ Query_log_event::peek_is_commit_rollback(packet->ptr() + ev_offset, len - ev_offset, |