1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +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:
Aleksey Midenkov
2018-04-25 23:33:08 +03:00
committed by Sergei Golubchik
parent fd4153f083
commit 68cad6aa24
6 changed files with 50 additions and 3 deletions

View File

@@ -8612,12 +8612,10 @@ bool TR_table::update(ulonglong start_id, ulonglong end_id)
if (!table && open())
return true;
timeval start_time= {thd->query_start(), long(thd->query_start_sec_part())};
thd->set_start_time();
store(FLD_BEGIN_TS, thd->transaction_time());
timeval end_time= {thd->query_start(), long(thd->query_start_sec_part())};
store(FLD_TRX_ID, start_id);
store(FLD_COMMIT_ID, end_id);
store(FLD_BEGIN_TS, start_time);
store(FLD_COMMIT_TS, end_time);
store_iso_level(thd->tx_isolation);