mirror of
https://github.com/MariaDB/server.git
synced 2025-07-24 19:42:23 +03:00
MDEV-16024 transaction_registry.begin_timestamp is wrong for explicit transactions
Store transaction start time in thd->transaction.start_time. THD::transaction_time() wraps over transaction.start_time taking into account current status of BEGIN.
This commit is contained in:
committed by
Sergei Golubchik
parent
fd4153f083
commit
68cad6aa24
@ -2627,6 +2627,15 @@ public:
|
||||
WT_THD wt; ///< for deadlock detection
|
||||
Rows_log_event *m_pending_rows_event;
|
||||
|
||||
struct st_trans_time : public timeval
|
||||
{
|
||||
void reset(THD *thd)
|
||||
{
|
||||
tv_sec= thd->query_start();
|
||||
tv_usec= (long) thd->query_start_sec_part();
|
||||
}
|
||||
} start_time;
|
||||
|
||||
/*
|
||||
Tables changed in transaction (that must be invalidated in query cache).
|
||||
List contain only transactional tables, that not invalidated in query
|
||||
@ -3470,6 +3479,13 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
timeval transaction_time()
|
||||
{
|
||||
if (!in_multi_stmt_transaction_mode())
|
||||
transaction.start_time.reset(this);
|
||||
return transaction.start_time;
|
||||
}
|
||||
|
||||
inline void set_start_time()
|
||||
{
|
||||
if (user_time.val)
|
||||
|
Reference in New Issue
Block a user