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

@@ -0,0 +1 @@
--plugin-load-add=test_versioning

View File

@@ -153,5 +153,21 @@ delete from t1;
select * from t1 for system_time as of timestamp'1990-1-1 00:00';
select * from t1 for system_time as of NULL;
--echo # MDEV-16024 transaction_registry.begin_timestamp is wrong for explicit transactions
create or replace table t1 (
x int(11) default null,
row_start bigint(20) unsigned generated always as row start invisible,
row_end bigint(20) unsigned generated always as row end invisible,
period for system_time (row_start, row_end)
) engine=innodb with system versioning;
begin;
set @ts1= now(6);
--sleep 0.01
insert into t1 values (1);
commit;
select row_start from t1 into @trx_id;
select trt_begin_ts(@trx_id) <= @ts1 as BEGIN_TS_GOOD;
drop database test;
create database test;