1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

IB: TRT is not updated on ADD SYSTEM VERSIONING [fixes #413]

This commit is contained in:
Eugene Kosov
2017-12-20 22:46:28 +03:00
committed by GitHub
parent 6e530d4df5
commit acdfacee75
8 changed files with 135 additions and 19 deletions

View File

@@ -165,20 +165,11 @@ alter table t
call verify_vtq;
show create table t;
## FIXME: #413 TRT is not updated on ADD SYSTEM VERSIONING
# alter table t drop column trx_start, drop column trx_end;
alter table t drop column trx_start, drop column trx_end;
# call verify_vtq;
# alter table t drop system versioning, algorithm=copy;
# call verify_vtq;
create or replace table t(
a int
) engine=innodb;
insert into t values (1);
## FIXME END
call verify_vtq;
alter table t drop system versioning, algorithm=copy;
call verify_vtq;
alter table t add system versioning, algorithm=copy;
call verify_vtq;

View File

@@ -29,4 +29,57 @@ delete from t1;
--error ER_VERS_TRT_IS_DISABLED
update t1 set x= 3;
--echo # ALTER ADD SYSTEM VERSIONING should write to mysql.transaction_registry
create function check_result (cond boolean)
returns char(50) deterministic
return if(cond = 1, '[CORRECT]', '[INCORRECT]');
set @@system_versioning_alter_history=keep;
set global system_versioning_transaction_registry=on;
create or replace table t1 (x int) engine innodb;
insert into t1 values (1);
alter table t1
add column s bigint unsigned as row start,
add column e bigint unsigned as row end,
add period for system_time(s, e),
add system versioning,
algorithm=inplace;
select s from t1 into @trx_start;
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
create or replace table t1 (x int) engine innodb;
select count(*) from mysql.transaction_registry into @tmp;
alter table t1
add column s bigint unsigned as row start,
add column e bigint unsigned as row end,
add period for system_time(s, e),
add system versioning,
algorithm=inplace;
select check_result(count(*) = @tmp) from mysql.transaction_registry;
create or replace table t1 (x int) engine innodb;
insert into t1 values (1);
alter table t1
add column s bigint unsigned as row start,
add column e bigint unsigned as row end,
add period for system_time(s, e),
add system versioning,
algorithm=copy;
select s from t1 into @trx_start;
select check_result(count(*) = 1) from mysql.transaction_registry where transaction_id = @trx_start;
create or replace table t1 (x int) engine innodb;
select count(*) from mysql.transaction_registry into @tmp;
alter table t1
add column s bigint unsigned as row start,
add column e bigint unsigned as row end,
add period for system_time(s, e),
add system versioning,
algorithm=copy;
select check_result(count(*) = @tmp) from mysql.transaction_registry;
drop table t1;
set global system_versioning_transaction_registry=off;
drop function check_result;