diff --git a/sql/engine_combination_tracker.h b/sql/engine_combination_tracker.h index 9d39bf1da9a..4674794f6b9 100644 --- a/sql/engine_combination_tracker.h +++ b/sql/engine_combination_tracker.h @@ -21,6 +21,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#pragma once #include #include diff --git a/sql/transaction.cc b/sql/transaction.cc index 715dd4c1d6d..6d57fc3c30b 100644 --- a/sql/transaction.cc +++ b/sql/transaction.cc @@ -539,6 +539,15 @@ bool trans_commit_stmt(THD *thd, bool ignore_global_read_lock) { if (thd->rpl_thd_ctx.session_gtids_ctx().notify_after_transaction_commit( thd)) LogErr(WARNING_LEVEL, ER_TRX_GTID_COLLECT_REJECT); + // KH: MyIsam does not register itself in m_ha_list, so if it is the only + // SE (no binlog), we don't get to the transaction cleanup + // where tracker.clear_known_engine() is called. + // This is workaround for commi 9e1c2f9e + if (!thd->in_active_multi_stmt_transaction()) { + // clear_known_engine() is enough to solve the problem + // thd->get_transaction()->tracker.clear_known_engine(); + thd->get_transaction()->cleanup(); + } /* In autocommit=1 mode the transaction should be marked as complete in P_S */ assert(thd->in_active_multi_stmt_transaction() || thd->m_transaction_psi == nullptr);