diff --git a/sql/binlog.cc b/sql/binlog.cc index 105876c..a6b75b6 100644 --- a/sql/binlog.cc +++ b/sql/binlog.cc @@ -8320,7 +8320,10 @@ std::pair MYSQL_BIN_LOG::flush_thread_caches(THD *thd) { this function documentation for more info. */ thd->set_trans_pos(log_file_name, m_binlog_file->position()); - if (wrote_xid) inc_prep_xids(thd); + if (wrote_xid || + thd->lex->sql_command == SQLCOM_XA_COMMIT || + thd->lex->sql_command == SQLCOM_XA_ROLLBACK) + inc_prep_xids(thd); } DBUG_PRINT("debug", ("bytes: %llu", bytes)); return std::make_pair(error, bytes);