mariadb/mysql-test/suite/versioning/r/sysvars.result

139 lines
4.8 KiB
Text
Raw Normal View History

create table t (a int) with system versioning;
insert into t values (1);
update t set a= 2;
2017-12-11 20:26:21 +01:00
show global variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof DEFAULT
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof DEFAULT
select * from t;
a
2
2017-12-11 20:26:21 +01:00
set system_versioning_asof= '2031-1-1 0:0:0';
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 2031-01-01 00:00:00.000000
select * from t;
a
2
2017-12-11 20:26:21 +01:00
set system_versioning_asof= '2011-1-1 0:0:0';
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 2011-01-01 00:00:00.000000
select * from t;
a
2017-12-11 20:26:21 +01:00
set global system_versioning_asof= 'alley';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
set global system_versioning_asof= null;
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'NULL'
set global system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set global system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set system_versioning_asof= 'alley';
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
set system_versioning_asof= null;
ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'NULL'
set system_versioning_asof= 1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set system_versioning_asof= 1.1;
ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
2017-12-11 20:26:21 +01:00
show global variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1911-11-11 11:11:11.111111
set global system_versioning_asof= '1900-01-01 00:00:00';
show global variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1900-01-01 00:00:00.000000
set global system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
Warnings:
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
2017-12-11 20:26:21 +01:00
show global variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1911-11-11 11:11:11.111111
set @ts= timestamp'1900-01-01 00:00:00';
2017-12-11 20:26:21 +01:00
set global system_versioning_asof= @ts;
show global variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1900-01-01 00:00:00.000000
set system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings:
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
2017-12-11 20:26:21 +01:00
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1911-11-11 11:11:11.111111
set system_versioning_asof= '1900-01-01 00:00:00';
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1900-01-01 00:00:00.000000
set system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
Warnings:
Note 1292 Truncated incorrect datetime value: '1911-11-11 11:11:11.1111119'
2017-12-11 20:26:21 +01:00
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1911-11-11 11:11:11.111111
set @ts= timestamp'1900-01-01 00:00:00';
2017-12-11 20:26:21 +01:00
set system_versioning_asof= @ts;
show variables like 'system_versioning_asof';
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_asof 1900-01-01 00:00:00.000000
set global system_versioning_asof= DEFAULT;
set system_versioning_asof= DEFAULT;
show variables where variable_name = "system_versioning_hide";
Variable_name Value
2017-12-11 20:26:21 +01:00
system_versioning_hide IMPLICIT
select * from t for system_time all;
a
2
1
2017-12-11 20:26:21 +01:00
set system_versioning_hide= AUTO;
select * from t;
a
2
select * from t for system_time as of timestamp current_timestamp(6);
a
2
select * from t for system_time all;
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP
select * from t for system_time from '0-0-0' to current_timestamp(6);
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP
select * from t for system_time between '0-0-0' and current_timestamp(6);
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP
2017-12-11 20:26:21 +01:00
set system_versioning_hide= NEVER;
select * from t;
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
2017-12-11 20:26:21 +01:00
set system_versioning_hide= FULL;
create or replace table t (
x int,
st timestamp(6) generated always as row start,
en timestamp(6) generated always as row end,
period for system_time (st, en))
with system versioning;
show create table t;
Table Create Table
t CREATE TABLE `t` (
`x` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t values (2);
delete from t;
select * from t;
x
select * from t for system_time all;
x
2
drop table t;
2017-12-11 20:26:21 +01:00
set system_versioning_hide= IMPLICIT;