From d1d472646d578608791dcd33c13ca6b2472e31b2 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 4 May 2020 14:20:14 +0300 Subject: Change THD->transaction to a pointer to enable multiple transactions All changes (except one) is of type thd->transaction. -> thd->transaction-> thd->transaction points by default to 'thd->default_transaction' This allows us to 'easily' have multiple active transactions for a THD object, like when reading data from the mysql.proc table --- sql/sql_sequence.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_sequence.cc') diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index f41221e11de..45bc519816a 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -437,7 +437,7 @@ int SEQUENCE::read_initial_values(TABLE *table) MYSQL_LOCK *lock; bool mdl_lock_used= 0; THD *thd= table->in_use; - bool has_active_transaction= !thd->transaction.stmt.is_empty(); + bool has_active_transaction= !thd->transaction->stmt.is_empty(); /* There is already a mdl_ticket for this table. However, for list_fields the MDL lock is of type MDL_SHARED_HIGH_PRIO which is not usable @@ -490,7 +490,7 @@ int SEQUENCE::read_initial_values(TABLE *table) But we also don't want to commit the stmt transaction while in a substatement, see MDEV-15977. */ - if (!has_active_transaction && !thd->transaction.stmt.is_empty() && + if (!has_active_transaction && !thd->transaction->stmt.is_empty() && !thd->in_sub_stmt) trans_commit_stmt(thd); } -- cgit v1.2.1