diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2018-04-25 23:33:08 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-05-12 10:16:46 +0200 |
commit | 68cad6aa243621f4f917ee67a3121946952e581c (patch) | |
tree | 52a16fdc6c202d4817a465485f2bdd4f58c6debe /mysql-test/suite/versioning/t | |
parent | fd4153f0835133ba92e30451feaf84ad1dd29283 (diff) | |
download | mariadb-git-68cad6aa243621f4f917ee67a3121946952e581c.tar.gz |
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.
Diffstat (limited to 'mysql-test/suite/versioning/t')
-rw-r--r-- | mysql-test/suite/versioning/t/trx_id.opt | 1 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/trx_id.test | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/suite/versioning/t/trx_id.opt b/mysql-test/suite/versioning/t/trx_id.opt new file mode 100644 index 00000000000..412290a7585 --- /dev/null +++ b/mysql-test/suite/versioning/t/trx_id.opt @@ -0,0 +1 @@ +--plugin-load-add=test_versioning diff --git a/mysql-test/suite/versioning/t/trx_id.test b/mysql-test/suite/versioning/t/trx_id.test index 0bf0e320835..4fb15f35366 100644 --- a/mysql-test/suite/versioning/t/trx_id.test +++ b/mysql-test/suite/versioning/t/trx_id.test @@ -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; |