mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user