Commit f1490133 authored by Sergei Golubchik's avatar Sergei Golubchik

rename versioning_* variables

parent ca6454bc
...@@ -4897,6 +4897,76 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -4897,6 +4897,76 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SYSTEM_VERSIONING_ALTER_HISTORY
SESSION_VALUE ERROR
GLOBAL_VALUE ERROR
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ERROR
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Versioning ALTER TABLE mode. ERROR: Fail ALTER with error; KEEP: Keep historical system rows and subject them to ALTER;
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST ERROR,KEEP
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SYSTEM_VERSIONING_ASOF
SESSION_VALUE DEFAULT
GLOBAL_VALUE DEFAULT
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE DEFAULT
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Default value for the FOR SYSTEM_TIME AS OF clause
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST DEFAULT
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME SYSTEM_VERSIONING_FORCE
SESSION_VALUE OFF
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Force system versioning for all created tables
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SYSTEM_VERSIONING_HIDE
SESSION_VALUE AUTO
GLOBAL_VALUE AUTO
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE AUTO
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Hide system versioning from being displayed in table info. AUTO: hide implicit system fields only in non-versioned and AS OF queries; IMPLICIT: hide implicit system fields in all queries; FULL: hide any system fields in all queries and hide versioning info in SHOW commands; NEVER: don't hide system fields
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST AUTO,IMPLICIT,FULL,NEVER
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SYSTEM_VERSIONING_INNODB_ALGORITHM_SIMPLE
SESSION_VALUE ON
GLOBAL_VALUE ON
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ON
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME TABLE_DEFINITION_CACHE VARIABLE_NAME TABLE_DEFINITION_CACHE
SESSION_VALUE NULL SESSION_VALUE NULL
GLOBAL_VALUE 400 GLOBAL_VALUE 400
...@@ -5373,76 +5443,6 @@ NUMERIC_BLOCK_SIZE NULL ...@@ -5373,76 +5443,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NEVER,COMPLEMENTARY,PREFERABLY ENUM_VALUE_LIST NEVER,COMPLEMENTARY,PREFERABLY
READ_ONLY NO READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME VERSIONING_ALTER_HISTORY
SESSION_VALUE ERROR
GLOBAL_VALUE ERROR
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ERROR
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Versioning ALTER TABLE mode. ERROR: Fail ALTER with error; KEEP: Keep historical system rows and subject them to ALTER;
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST ERROR,KEEP
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME VERSIONING_ASOF_TIMESTAMP
SESSION_VALUE CURRENT
GLOBAL_VALUE CURRENT
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE CURRENT
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
VARIABLE_COMMENT Default AS OF value for versioned queries
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST CURRENT,ALL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME VERSIONING_FORCE
SESSION_VALUE OFF
GLOBAL_VALUE OFF
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE OFF
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Force system versioning for all created tables
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME VERSIONING_HIDE
SESSION_VALUE AUTO
GLOBAL_VALUE AUTO
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE AUTO
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
VARIABLE_COMMENT Hide system versioning from being displayed in table info. AUTO: hide implicit system fields only in non-versioned and AS OF queries; IMPLICIT: hide implicit system fields in all queries; FULL: hide any system fields in all queries and hide versioning info in SHOW commands; NEVER: don't hide system fields
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST AUTO,IMPLICIT,FULL,NEVER
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME VERSIONING_INNODB_ALGORITHM_SIMPLE
SESSION_VALUE ON
GLOBAL_VALUE ON
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE ON
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
VARIABLE_COMMENT Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME WAIT_TIMEOUT VARIABLE_NAME WAIT_TIMEOUT
SESSION_VALUE 28800 SESSION_VALUE 28800
GLOBAL_VALUE 28800 GLOBAL_VALUE 28800
......
--versioning-hide=implicit --system-versioning-hide=implicit
--plugin-load=versioning --plugin-load=versioning
select @@versioning_alter_history; select @@system_versioning_alter_history;
@@versioning_alter_history @@system_versioning_alter_history
ERROR ERROR
create table t( create table t(
a int a int
...@@ -21,7 +21,7 @@ t CREATE TABLE `t` ( ...@@ -21,7 +21,7 @@ t CREATE TABLE `t` (
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`) PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING ) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
alter table t add column y int; alter table t add column y int;
ERROR HY000: Not allowed for versioned `test`.`t`. Change `versioning_alter_history` to proceed with ALTER. ERROR HY000: Not allowed for versioned `test`.`t`. Change @@system_versioning_alter_history to proceed with ALTER.
alter table t engine innodb; alter table t engine innodb;
ERROR HY000: Not allowed for versioned `test`.`t`. Change to/from native versioning engine is prohibited. ERROR HY000: Not allowed for versioned `test`.`t`. Change to/from native versioning engine is prohibited.
alter table t drop system versioning; alter table t drop system versioning;
...@@ -30,7 +30,7 @@ Table Create Table ...@@ -30,7 +30,7 @@ Table Create Table
t CREATE TABLE `t` ( t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
set versioning_alter_history= keep; set system_versioning_alter_history= keep;
alter table t alter table t
add column trx_start bigint(20) unsigned generated always as row start, add column trx_start bigint(20) unsigned generated always as row start,
add column trx_end bigint(20) unsigned generated always as row end, add column trx_end bigint(20) unsigned generated always as row end,
...@@ -503,9 +503,9 @@ Table Create Table ...@@ -503,9 +503,9 @@ Table Create Table
t CREATE TABLE `t` ( t CREATE TABLE `t` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
set versioning_alter_history= SURVIVE; set system_versioning_alter_history= SURVIVE;
ERROR 42000: Variable 'versioning_alter_history' can't be set to the value of 'SURVIVE' ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'SURVIVE'
set versioning_alter_history= DROP; set system_versioning_alter_history= DROP;
ERROR 42000: Variable 'versioning_alter_history' can't be set to the value of 'DROP' ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'DROP'
drop database test; drop database test;
create database test; create database test;
...@@ -48,23 +48,23 @@ dept for system_time from timestamp @ts_1 to timestamp @ts_2 d ...@@ -48,23 +48,23 @@ dept for system_time from timestamp @ts_1 to timestamp @ts_2 d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
emp_id dept_id name salary sys_trx_start sys_trx_end dept_id name sys_trx_start sys_trx_end emp_id dept_id name salary sys_trx_start sys_trx_end dept_id name sys_trx_start sys_trx_end
set statement versioning_asof_timestamp=@ts_0 for set statement system_versioning_asof=@ts_0 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
emp_id dept_id name salary dept_id name emp_id dept_id name salary dept_id name
set statement versioning_asof_timestamp=@ts_1 for set statement system_versioning_asof=@ts_1 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
emp_id dept_id name salary dept_id name emp_id dept_id name salary dept_id name
set statement versioning_asof_timestamp=@ts_2 for set statement system_versioning_asof=@ts_2 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
emp_id dept_id name salary dept_id name emp_id dept_id name salary dept_id name
1 10 bill 1000 10 accounting 1 10 bill 1000 10 accounting
set statement versioning_asof_timestamp=@ts_3 for set statement system_versioning_asof=@ts_3 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
......
create table t (a int) with system versioning; create table t (a int) with system versioning;
insert into t values (1); insert into t values (1);
update t set a= 2; update t set a= 2;
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp CURRENT system_versioning_asof DEFAULT
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp CURRENT system_versioning_asof DEFAULT
select * from t; select * from t;
a a
2 2
set versioning_asof_timestamp= '2031-1-1 0:0:0'; set system_versioning_asof= '2031-1-1 0:0:0';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 2031-01-01 00:00:00.000000 system_versioning_asof 2031-01-01 00:00:00.000000
select * from t; select * from t;
a a
2 2
set versioning_asof_timestamp= '2011-1-1 0:0:0'; set system_versioning_asof= '2011-1-1 0:0:0';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 2011-01-01 00:00:00.000000 system_versioning_asof 2011-01-01 00:00:00.000000
select * from t; select * from t;
a a
set versioning_asof_timestamp= ALL; set global system_versioning_asof= 'alley';
show variables like 'versioning_asof_timestamp'; ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
Variable_name Value set global system_versioning_asof= null;
versioning_asof_timestamp ALL ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'NULL'
select * from t; set global system_versioning_asof= 1;
a ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
2 set global system_versioning_asof= 1.1;
1 ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
create view vt as select * from t; set system_versioning_asof= 'alley';
select * from t; ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'alley'
a set system_versioning_asof= null;
2 ERROR 42000: Variable 'system_versioning_asof' can't be set to the value of 'NULL'
1 set system_versioning_asof= 1;
drop view vt; ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
select * from (select * from t) as tt; set system_versioning_asof= 1.1;
a ERROR 42000: Incorrect argument type to variable 'system_versioning_asof'
2 set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
1
set global versioning_asof_timestamp= 'alley';
ERROR 42000: Variable 'versioning_asof_timestamp' can't be set to the value of 'alley'
set global versioning_asof_timestamp= null;
ERROR 42000: Variable 'versioning_asof_timestamp' can't be set to the value of 'NULL'
set global versioning_asof_timestamp= 1;
ERROR 42000: Incorrect argument type to variable 'versioning_asof_timestamp'
set global versioning_asof_timestamp= 1.1;
ERROR 42000: Incorrect argument type to variable 'versioning_asof_timestamp'
set versioning_asof_timestamp= 'alley';
ERROR 42000: Variable 'versioning_asof_timestamp' can't be set to the value of 'alley'
set versioning_asof_timestamp= null;
ERROR 42000: Variable 'versioning_asof_timestamp' can't be set to the value of 'NULL'
set versioning_asof_timestamp= 1;
ERROR 42000: Incorrect argument type to variable 'versioning_asof_timestamp'
set versioning_asof_timestamp= 1.1;
ERROR 42000: Incorrect argument type to variable 'versioning_asof_timestamp'
set global versioning_asof_timestamp= '1911-11-11 11:11:11.1111119';
Warnings: 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'
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'
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1911-11-11 11:11:11.111111 system_versioning_asof 1911-11-11 11:11:11.111111
set global versioning_asof_timestamp= '1900-01-01 00:00:00'; set global system_versioning_asof= '1900-01-01 00:00:00';
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1900-01-01 00:00:00.000000 system_versioning_asof 1900-01-01 00:00:00.000000
set global versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; set global system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
Warnings: 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'
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1911-11-11 11:11:11.111111 system_versioning_asof 1911-11-11 11:11:11.111111
set @ts= timestamp'1900-01-01 00:00:00'; set @ts= timestamp'1900-01-01 00:00:00';
set global versioning_asof_timestamp= @ts; set global system_versioning_asof= @ts;
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1900-01-01 00:00:00.000000 system_versioning_asof 1900-01-01 00:00:00.000000
set versioning_asof_timestamp= '1911-11-11 11:11:11.1111119'; set system_versioning_asof= '1911-11-11 11:11:11.1111119';
Warnings: 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'
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'
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1911-11-11 11:11:11.111111 system_versioning_asof 1911-11-11 11:11:11.111111
set versioning_asof_timestamp= '1900-01-01 00:00:00'; set system_versioning_asof= '1900-01-01 00:00:00';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1900-01-01 00:00:00.000000 system_versioning_asof 1900-01-01 00:00:00.000000
set versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; set system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
Warnings: 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'
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1911-11-11 11:11:11.111111 system_versioning_asof 1911-11-11 11:11:11.111111
set @ts= timestamp'1900-01-01 00:00:00'; set @ts= timestamp'1900-01-01 00:00:00';
set versioning_asof_timestamp= @ts; set system_versioning_asof= @ts;
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
Variable_name Value Variable_name Value
versioning_asof_timestamp 1900-01-01 00:00:00.000000 system_versioning_asof 1900-01-01 00:00:00.000000
set global versioning_asof_timestamp= CURRENT; set global system_versioning_asof= DEFAULT;
set versioning_asof_timestamp= CURRENT; set system_versioning_asof= DEFAULT;
show variables where variable_name = "versioning_hide"; show variables where variable_name = "system_versioning_hide";
Variable_name Value Variable_name Value
versioning_hide IMPLICIT system_versioning_hide IMPLICIT
select * from t for system_time all; select * from t for system_time all;
a a
2 2
1 1
set versioning_hide= AUTO; set system_versioning_hide= AUTO;
select * from t; select * from t;
a a
2 2
...@@ -129,11 +111,11 @@ select * from t for system_time between '0-0-0' and current_timestamp(6); ...@@ -129,11 +111,11 @@ select * from t for system_time between '0-0-0' and current_timestamp(6);
a sys_trx_start sys_trx_end a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP 2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP 1 TIMESTAMP TIMESTAMP
set versioning_hide= NEVER; set system_versioning_hide= NEVER;
select * from t; select * from t;
a sys_trx_start sys_trx_end a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP 2 TIMESTAMP TIMESTAMP
set versioning_hide= FULL; set system_versioning_hide= FULL;
create or replace table t ( create or replace table t (
x int, x int,
st timestamp(6) generated always as row start, st timestamp(6) generated always as row start,
...@@ -153,4 +135,4 @@ select * from t for system_time all; ...@@ -153,4 +135,4 @@ select * from t for system_time all;
x x
2 2
drop table t; drop table t;
set versioning_hide= IMPLICIT; set system_versioning_hide= IMPLICIT;
select @@versioning_alter_history; select @@system_versioning_alter_history;
create table t( create table t(
a int a int
...@@ -18,7 +18,7 @@ alter table t engine innodb; ...@@ -18,7 +18,7 @@ alter table t engine innodb;
alter table t drop system versioning; alter table t drop system versioning;
show create table t; show create table t;
set versioning_alter_history= keep; set system_versioning_alter_history= keep;
--error ER_VERS_FIELD_WRONG_TYPE --error ER_VERS_FIELD_WRONG_TYPE
alter table t alter table t
...@@ -287,10 +287,10 @@ show create table t; ...@@ -287,10 +287,10 @@ show create table t;
## These experimental options are now disabled ## These experimental options are now disabled
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set versioning_alter_history= SURVIVE; set system_versioning_alter_history= SURVIVE;
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set versioning_alter_history= DROP; set system_versioning_alter_history= DROP;
if (0) if (0)
{ {
......
--plugin-load=versioning --plugin-load=versioning
--versioning-hide=implicit --system-versioning-hide=implicit
--versioning-hide=implicit --system-versioning-hide=implicit
--partition --system-versioning-hide=implicit
--versioning-hide=implicit
-- source include/have_partition.inc
-- source suite/versioning/common.inc -- source suite/versioning/common.inc
### check System Versioning and conventional partitioning ### check System Versioning and conventional partitioning
......
--versioning-hide=implicit --system-versioning-hide=implicit
...@@ -50,22 +50,22 @@ select * from ...@@ -50,22 +50,22 @@ select * from
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
set statement versioning_asof_timestamp=@ts_0 for set statement system_versioning_asof=@ts_0 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
set statement versioning_asof_timestamp=@ts_1 for set statement system_versioning_asof=@ts_1 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
set statement versioning_asof_timestamp=@ts_2 for set statement system_versioning_asof=@ts_2 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
set statement versioning_asof_timestamp=@ts_3 for set statement system_versioning_asof=@ts_3 for
select * from emp e, dept d select * from emp e, dept d
where d.dept_id = 10 where d.dept_id = 10
and d.dept_id = e.dept_id; and d.dept_id = e.dept_id;
......
--versioning-hide=implicit --system-versioning-hide=implicit
...@@ -2,83 +2,73 @@ create table t (a int) with system versioning; ...@@ -2,83 +2,73 @@ create table t (a int) with system versioning;
insert into t values (1); insert into t values (1);
update t set a= 2; update t set a= 2;
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
select * from t; select * from t;
set versioning_asof_timestamp= '2031-1-1 0:0:0'; set system_versioning_asof= '2031-1-1 0:0:0';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
select * from t; select * from t;
set versioning_asof_timestamp= '2011-1-1 0:0:0'; set system_versioning_asof= '2011-1-1 0:0:0';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
select * from t; select * from t;
set versioning_asof_timestamp= ALL;
show variables like 'versioning_asof_timestamp';
select * from t;
create view vt as select * from t;
select * from t;
drop view vt;
select * from (select * from t) as tt;
# global # global
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global versioning_asof_timestamp= 'alley'; set global system_versioning_asof= 'alley';
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global versioning_asof_timestamp= null; set global system_versioning_asof= null;
--error ER_WRONG_TYPE_FOR_VAR --error ER_WRONG_TYPE_FOR_VAR
set global versioning_asof_timestamp= 1; set global system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR --error ER_WRONG_TYPE_FOR_VAR
set global versioning_asof_timestamp= 1.1; set global system_versioning_asof= 1.1;
# session # session
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set versioning_asof_timestamp= 'alley'; set system_versioning_asof= 'alley';
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set versioning_asof_timestamp= null; set system_versioning_asof= null;
--error ER_WRONG_TYPE_FOR_VAR --error ER_WRONG_TYPE_FOR_VAR
set versioning_asof_timestamp= 1; set system_versioning_asof= 1;
--error ER_WRONG_TYPE_FOR_VAR --error ER_WRONG_TYPE_FOR_VAR
set versioning_asof_timestamp= 1.1; set system_versioning_asof= 1.1;
# global # global
set global versioning_asof_timestamp= '1911-11-11 11:11:11.1111119'; set global system_versioning_asof= '1911-11-11 11:11:11.1111119';
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
set global versioning_asof_timestamp= '1900-01-01 00:00:00'; set global system_versioning_asof= '1900-01-01 00:00:00';
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
set global versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; set global system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
set @ts= timestamp'1900-01-01 00:00:00'; set @ts= timestamp'1900-01-01 00:00:00';
set global versioning_asof_timestamp= @ts; set global system_versioning_asof= @ts;
show global variables like 'versioning_asof_timestamp'; show global variables like 'system_versioning_asof';
# session # session
set versioning_asof_timestamp= '1911-11-11 11:11:11.1111119'; set system_versioning_asof= '1911-11-11 11:11:11.1111119';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
set versioning_asof_timestamp= '1900-01-01 00:00:00'; set system_versioning_asof= '1900-01-01 00:00:00';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
set versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; set system_versioning_asof= timestamp'1911-11-11 11:11:11.1111119';
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
set @ts= timestamp'1900-01-01 00:00:00'; set @ts= timestamp'1900-01-01 00:00:00';
set versioning_asof_timestamp= @ts; set system_versioning_asof= @ts;
show variables like 'versioning_asof_timestamp'; show variables like 'system_versioning_asof';
set global versioning_asof_timestamp= CURRENT; set global system_versioning_asof= DEFAULT;
set versioning_asof_timestamp= CURRENT; set system_versioning_asof= DEFAULT;
show variables where variable_name = "versioning_hide"; show variables where variable_name = "system_versioning_hide";
select * from t for system_time all; select * from t for system_time all;
set versioning_hide= AUTO; set system_versioning_hide= AUTO;
select * from t; select * from t;
select * from t for system_time as of timestamp current_timestamp(6); 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/ --replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/
...@@ -88,11 +78,11 @@ select * from t for system_time from '0-0-0' to current_timestamp(6); ...@@ -88,11 +78,11 @@ 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/ --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); select * from t for system_time between '0-0-0' and current_timestamp(6);
set versioning_hide= NEVER; set system_versioning_hide= NEVER;
--replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/ --replace_regex /\d{4}-\d\d-\d\d \d\d:\d\d:\d\d\.\d{6}/TIMESTAMP/
select * from t; select * from t;
set versioning_hide= FULL; set system_versioning_hide= FULL;
create or replace table t ( create or replace table t (
x int, x int,
st timestamp(6) generated always as row start, st timestamp(6) generated always as row start,
...@@ -108,4 +98,4 @@ select * from t; ...@@ -108,4 +98,4 @@ select * from t;
select * from t for system_time all; select * from t for system_time all;
drop table t; drop table t;
set versioning_hide= IMPLICIT; set system_versioning_hide= IMPLICIT;
--versioning-hide=implicit --system-versioning-hide=implicit
--versioning-hide=implicit --system-versioning-hide=implicit
...@@ -23,7 +23,7 @@ set sql_mode=''; ...@@ -23,7 +23,7 @@ set sql_mode='';
set @orig_storage_engine=@@storage_engine; set @orig_storage_engine=@@storage_engine;
set storage_engine=myisam; set storage_engine=myisam;
set versioning_alter_history=keep; set system_versioning_alter_history=keep;
set @have_innodb= (select count(engine) from information_schema.engines where engine='INNODB' and support != 'NO'); set @have_innodb= (select count(engine) from information_schema.engines where engine='INNODB' and support != 'NO');
SET @innodb_or_myisam=IF(@have_innodb <> 0, 'InnoDB', 'MyISAM'); SET @innodb_or_myisam=IF(@have_innodb <> 0, 'InnoDB', 'MyISAM');
......
...@@ -7852,7 +7852,7 @@ WARN_VERS_PART_NON_HISTORICAL ...@@ -7852,7 +7852,7 @@ WARN_VERS_PART_NON_HISTORICAL
eng "Partition %`s contains non-historical data" eng "Partition %`s contains non-historical data"
ER_VERS_ALTER_NOT_ALLOWED ER_VERS_ALTER_NOT_ALLOWED
eng "Not allowed for versioned %`s.%`s. Change `versioning_alter_history` to proceed with ALTER." eng "Not allowed for versioned %`s.%`s. Change @@system_versioning_alter_history to proceed with ALTER."
ER_VERS_ALTER_ENGINE_PROHIBITED ER_VERS_ALTER_ENGINE_PROHIBITED
eng "Not allowed for versioned %`s.%`s. Change to/from native versioning engine is prohibited." eng "Not allowed for versioned %`s.%`s. Change to/from native versioning engine is prohibited."
......
...@@ -387,19 +387,19 @@ static Sys_var_charptr Sys_my_bind_addr( ...@@ -387,19 +387,19 @@ static Sys_var_charptr Sys_my_bind_addr(
READ_ONLY GLOBAL_VAR(my_bind_addr_str), CMD_LINE(REQUIRED_ARG), READ_ONLY GLOBAL_VAR(my_bind_addr_str), CMD_LINE(REQUIRED_ARG),
IN_FS_CHARSET, DEFAULT(0)); IN_FS_CHARSET, DEFAULT(0));
const char *Sys_var_vers_asof::asof_keywords[]= {"CURRENT", "ALL", NULL}; const char *Sys_var_vers_asof::asof_keywords[]= {"DEFAULT", NULL};
static Sys_var_vers_asof Sys_vers_asof_timestamp( static Sys_var_vers_asof Sys_vers_asof_timestamp(
"versioning_asof_timestamp", "Default AS OF value for versioned queries", "system_versioning_asof", "Default value for the FOR SYSTEM_TIME AS OF clause",
SESSION_VAR(vers_asof_timestamp.type), NO_CMD_LINE, SESSION_VAR(vers_asof_timestamp.type), NO_CMD_LINE,
Sys_var_vers_asof::asof_keywords, DEFAULT(FOR_SYSTEM_TIME_UNSPECIFIED)); Sys_var_vers_asof::asof_keywords, DEFAULT(FOR_SYSTEM_TIME_UNSPECIFIED));
static Sys_var_mybool Sys_vers_force( static Sys_var_mybool Sys_vers_force(
"versioning_force", "Force system versioning for all created tables", "system_versioning_force", "Force system versioning for all created tables",
SESSION_VAR(vers_force), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); SESSION_VAR(vers_force), CMD_LINE(OPT_ARG), DEFAULT(FALSE));
static const char *vers_hide_keywords[]= {"AUTO", "IMPLICIT", "FULL", "NEVER", NULL}; static const char *vers_hide_keywords[]= {"AUTO", "IMPLICIT", "FULL", "NEVER", NULL};
static Sys_var_enum Sys_vers_hide( static Sys_var_enum Sys_vers_hide(
"versioning_hide", "Hide system versioning from being displayed in table info. " "system_versioning_hide", "Hide system versioning from being displayed in table info. "
"AUTO: hide implicit system fields only in non-versioned and AS OF queries; " "AUTO: hide implicit system fields only in non-versioned and AS OF queries; "
"IMPLICIT: hide implicit system fields in all queries; " "IMPLICIT: hide implicit system fields in all queries; "
"FULL: hide any system fields in all queries and hide versioning info in SHOW commands; " "FULL: hide any system fields in all queries and hide versioning info in SHOW commands; "
...@@ -408,14 +408,14 @@ static Sys_var_enum Sys_vers_hide( ...@@ -408,14 +408,14 @@ static Sys_var_enum Sys_vers_hide(
vers_hide_keywords, DEFAULT(VERS_HIDE_AUTO)); vers_hide_keywords, DEFAULT(VERS_HIDE_AUTO));
static Sys_var_mybool Sys_vers_innodb_algorithm_simple( static Sys_var_mybool Sys_vers_innodb_algorithm_simple(
"versioning_innodb_algorithm_simple", "system_versioning_innodb_algorithm_simple",
"Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES", "Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES",
SESSION_VAR(vers_innodb_algorithm_simple), CMD_LINE(OPT_ARG), SESSION_VAR(vers_innodb_algorithm_simple), CMD_LINE(OPT_ARG),
DEFAULT(TRUE)); DEFAULT(TRUE));
static const char *vers_alter_history_keywords[]= {"ERROR", "KEEP",/* "SURVIVE", "DROP",*/ NULL}; static const char *vers_alter_history_keywords[]= {"ERROR", "KEEP",/* "SURVIVE", "DROP",*/ NULL};
static Sys_var_enum Sys_vers_alter_history( static Sys_var_enum Sys_vers_alter_history(
"versioning_alter_history", "Versioning ALTER TABLE mode. " "system_versioning_alter_history", "Versioning ALTER TABLE mode. "
"ERROR: Fail ALTER with error; " /* TODO: fail only when history non-empty */ "ERROR: Fail ALTER with error; " /* TODO: fail only when history non-empty */
"KEEP: Keep historical system rows and subject them to ALTER; " "KEEP: Keep historical system rows and subject them to ALTER; "
/*"SURVIVE: Keep historical system rows intact; " /*"SURVIVE: Keep historical system rows intact; "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment