SQL: TRX_ID to TIMESTAMP versioning switch [fixes #428]

This commit is contained in:
Eugene Kosov 2017-12-27 16:41:43 +03:00
commit d72462a29b
3 changed files with 44 additions and 26 deletions

View file

@ -79,6 +79,18 @@ algorithm=copy;
select check_result(count(*) = @tmp) from mysql.transaction_registry;
check_result(count(*) = @tmp)
[CORRECT]
# TRX_ID to TIMESTAMP versioning switch
create or replace table t1 (
x int,
sys_start bigint unsigned as row start invisible,
sys_end bigint unsigned as row end invisible,
period for system_time (sys_start, sys_end)
) engine innodb with system versioning;
insert into t1 values (1);
alter table t1 drop column sys_start, drop column sys_end;
select sys_end = 18446744073709551615 as transaction_based from t1 for system_time all;
transaction_based
1
drop table t1;
set global system_versioning_transaction_registry=off;
drop function check_result;

View file

@ -81,6 +81,17 @@ alter table t1
select check_result(count(*) = @tmp) from mysql.transaction_registry;
--echo # TRX_ID to TIMESTAMP versioning switch
create or replace table t1 (
x int,
sys_start bigint unsigned as row start invisible,
sys_end bigint unsigned as row end invisible,
period for system_time (sys_start, sys_end)
) engine innodb with system versioning;
insert into t1 values (1);
alter table t1 drop column sys_start, drop column sys_end;
select sys_end = 18446744073709551615 as transaction_based from t1 for system_time all;
drop table t1;
set global system_versioning_transaction_registry=off;
drop function check_result;