mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
Tests: mariabackup.system_versioning [#387]
This commit is contained in:
parent
e6c5eb5c58
commit
d6b68b0e8d
2 changed files with 62 additions and 6 deletions
|
@ -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
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue