Skip to content

Commit

Permalink
Tests: mariabackup.system_versioning [#387]
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgs committed Dec 21, 2017
1 parent e6c5eb5 commit d6b68b0
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 6 deletions.
37 changes: 33 additions & 4 deletions mysql-test/suite/mariabackup/system_versioning.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ insert into t values (3);
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL,
`sys_trx_start` SYS_TRX_TYPE GENERATED ALWAYS AS ROW START,
`sys_trx_end` SYS_TRX_TYPE GENERATED ALWAYS AS ROW END,
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
`a` int(11) DEFAULT NULL
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
select * from t;
a
Expand All @@ -21,4 +18,36 @@ select a from t for system_time all;
a
2
1
set global system_versioning_transaction_registry=on;
Warnings:
Warning 4144 Transaction-based system versioning is EXPERIMENTAL and is subject to change in future.
create or replace table t (
a int,
s bigint unsigned as row start invisible,
e bigint unsigned as row end invisible,
period for system_time(s, e)
) with system versioning engine=innodb;
insert into t values (1);
update t set a=2;
insert into t values (3);
# shutdown server
# remove datadir
# xtrabackup move back
# restart server
show create table t;
Table Create Table
t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL,
`s` bigint(20) unsigned GENERATED ALWAYS AS ROW START INVISIBLE,
`e` bigint(20) unsigned GENERATED ALWAYS AS ROW END INVISIBLE,
PERIOD FOR SYSTEM_TIME (`s`, `e`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
select * from t;
a
2
select a from t for system_time all;
a
2
1
drop table t;
set global system_versioning_transaction_registry=off;
31 changes: 29 additions & 2 deletions mysql-test/suite/mariabackup/system_versioning.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,38 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
-- source include/restart_and_restore.inc
--enable_result_log

--replace_result "bigint unsigned" SYS_TRX_TYPE timestamp(6) SYS_TRX_TYPE
--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM "bigint(20) unsigned" SYS_TRX_TYPE timestamp(6) SYS_TRX_TYPE
--replace_result InnoDB INNODB_OR_MYISAM MyISAM INNODB_OR_MYISAM
show create table t;
select * from t;
select a from t for system_time all;

rmdir $targetdir;

set global system_versioning_transaction_registry=on;
create or replace table t (
a int,
s bigint unsigned as row start invisible,
e bigint unsigned as row end invisible,
period for system_time(s, e)
) with system versioning engine=innodb;
insert into t values (1);
update t set a=2;

--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
--enable_result_log

insert into t values (3);

--disable_result_log
exec $XTRABACKUP --prepare --target-dir=$targetdir;
-- source include/restart_and_restore.inc
--enable_result_log

show create table t;
select * from t;
select a from t for system_time all;

drop table t;
set global system_versioning_transaction_registry=off;
rmdir $targetdir;

0 comments on commit d6b68b0

Please sign in to comment.