| 1 |
create table t (a int) with system versioning; |
| 2 |
insert into t values (1); |
| 3 |
update t set a=2; |
| 4 |
insert into t values (3); |
| 5 |
# shutdown server |
| 6 |
# remove datadir |
| 7 |
# xtrabackup move back |
| 8 |
# restart |
| 9 |
show create table t; |
| 10 |
Table Create Table |
| 11 |
t CREATE TABLE `t` ( |
| 12 |
`a` int(11) DEFAULT NULL |
| 13 |
) ENGINE=INNODB_OR_MYISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci WITH SYSTEM VERSIONING |
| 14 |
select * from t; |
| 15 |
a |
| 16 |
2 |
| 17 |
select a from t for system_time all; |
| 18 |
a |
| 19 |
2 |
| 20 |
1 |
| 21 |
create or replace table t ( |
| 22 |
a int, |
| 23 |
s bigint unsigned as row start invisible, |
| 24 |
e bigint unsigned as row end invisible, |
| 25 |
period for system_time(s, e) |
| 26 |
) with system versioning engine=innodb; |
| 27 |
insert into t values (1); |
| 28 |
update t set a=2; |
| 29 |
insert into t values (3); |
| 30 |
# shutdown server |
| 31 |
# remove datadir |
| 32 |
# xtrabackup move back |
| 33 |
# restart |
| 34 |
show create table t; |
| 35 |
Table Create Table |
| 36 |
t CREATE TABLE `t` ( |
| 37 |
`a` int(11) DEFAULT NULL, |
| 38 |
`s` bigint(20) unsigned GENERATED ALWAYS AS ROW START INVISIBLE, |
| 39 |
`e` bigint(20) unsigned GENERATED ALWAYS AS ROW END INVISIBLE, |
| 40 |
PERIOD FOR SYSTEM_TIME (`s`, `e`) |
| 41 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci WITH SYSTEM VERSIONING |
| 42 |
select * from t; |
| 43 |
a |
| 44 |
2 |
| 45 |
select a from t for system_time all; |
| 46 |
a |
| 47 |
2 |
| 48 |
1 |
| 49 |
drop table t; |