mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
102 lines
3.1 KiB
Plaintext
102 lines
3.1 KiB
Plaintext
create table t (a int) with system versioning;
|
|
insert into t values (1);
|
|
update t set a= 2;
|
|
|
|
show global variables like 'system_versioning_asof';
|
|
show variables like 'system_versioning_asof';
|
|
select * from t;
|
|
|
|
set system_versioning_asof= '2031-1-1 0:0:0';
|
|
show variables like 'system_versioning_asof';
|
|
select * from t;
|
|
|
|
set system_versioning_asof= '2011-1-1 0:0:0';
|
|
show variables like 'system_versioning_asof';
|
|
select * from t;
|
|
|
|
# global
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
set global system_versioning_asof= 'alley';
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
set global system_versioning_asof= null;
|
|
--error ER_WRONG_TYPE_FOR_VAR
|
|
set global system_versioning_asof= 1;
|
|
--error ER_WRONG_TYPE_FOR_VAR
|
|
set global system_versioning_asof= 1.1;
|
|
|
|
# session
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
set system_versioning_asof= 'alley';
|
|
--error ER_WRONG_VALUE_FOR_VAR
|
|
set system_versioning_asof= null;
|
|
--error ER_WRONG_TYPE_FOR_VAR
|
|
set system_versioning_asof= 1;
|
|
--error ER_WRONG_TYPE_FOR_VAR
|
|
set system_versioning_asof= 1.1;
|
|
|
|
# global
|
|
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
|
|
show global variables like 'system_versioning_asof';
|
|
|
|
set global system_versioning_asof= '1900-01-01 00:00:00';
|
|
show global variables like 'system_versioning_asof';
|
|
|
|
set global system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
|
|
show global variables like 'system_versioning_asof';
|
|
|
|
set @ts= timestamp'1900-01-01 00:00:00';
|
|
set global system_versioning_asof= @ts;
|
|
show global variables like 'system_versioning_asof';
|
|
|
|
# session
|
|
set system_versioning_asof= '1911-11-11 11:11:11.1111119';
|
|
show variables like 'system_versioning_asof';
|
|
|
|
set system_versioning_asof= '1900-01-01 00:00:00';
|
|
show variables like 'system_versioning_asof';
|
|
|
|
set system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
|
|
show variables like 'system_versioning_asof';
|
|
|
|
set @ts= timestamp'1900-01-01 00:00:00';
|
|
set system_versioning_asof= @ts;
|
|
show variables like 'system_versioning_asof';
|
|
|
|
set global system_versioning_asof= DEFAULT;
|
|
set system_versioning_asof= DEFAULT;
|
|
|
|
show variables where variable_name = "system_versioning_hide";
|
|
select * from t for system_time all;
|
|
|
|
set system_versioning_hide= AUTO;
|
|
select * from t;
|
|
select * from t for system_time as of timestamp current_timestamp(6);
|
|
--replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/
|
|
select * from t for system_time all;
|
|
--replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/
|
|
select * from t for system_time from '0-0-0' to current_timestamp(6);
|
|
--replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/
|
|
select * from t for system_time between '0-0-0' and current_timestamp(6);
|
|
|
|
set system_versioning_hide= NEVER;
|
|
--replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/
|
|
select * from t;
|
|
|
|
set system_versioning_hide= FULL;
|
|
create or replace table t (
|
|
x int,
|
|
st timestamp(6) as row start invisible,
|
|
en timestamp(6) as row end invisible,
|
|
period for system_time (st, en))
|
|
with system versioning;
|
|
|
|
show create table t;
|
|
insert into t values (2);
|
|
delete from t;
|
|
|
|
select * from t;
|
|
select * from t for system_time all;
|
|
|
|
drop table t;
|
|
set system_versioning_hide= IMPLICIT;
|