From f149013393dcef06940cc82f11247ceafb935fae Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 11 Dec 2017 20:26:21 +0100 Subject: [PATCH] rename versioning_* variables --- .../r/sysvars_server_notembedded.result | 140 +++++++++--------- mysql-test/suite/versioning/common.opt | 2 +- mysql-test/suite/versioning/r/alter.result | 16 +- mysql-test/suite/versioning/r/simple.result | 8 +- mysql-test/suite/versioning/r/sysvars.result | 134 ++++++++--------- mysql-test/suite/versioning/t/alter.test | 8 +- mysql-test/suite/versioning/t/cte.opt | 2 +- mysql-test/suite/versioning/t/foreign.opt | 2 +- mysql-test/suite/versioning/t/partition.opt | 3 +- mysql-test/suite/versioning/t/partition.test | 1 + mysql-test/suite/versioning/t/rpl.opt | 2 +- mysql-test/suite/versioning/t/simple.test | 8 +- mysql-test/suite/versioning/t/sysvars.opt | 2 +- mysql-test/suite/versioning/t/sysvars.test | 84 +++++------ mysql-test/suite/versioning/t/truncate.opt | 2 +- mysql-test/suite/versioning/t/view.opt | 2 +- scripts/mysql_system_tables.sql | 2 +- sql/share/errmsg-utf8.txt | 2 +- sql/sys_vars.cc | 12 +- 19 files changed, 202 insertions(+), 230 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 24d3e897bb03a..173c2de3483d2 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -4897,6 +4897,76 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO 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 SESSION_VALUE NULL GLOBAL_VALUE 400 @@ -5373,76 +5443,6 @@ NUMERIC_BLOCK_SIZE NULL ENUM_VALUE_LIST NEVER,COMPLEMENTARY,PREFERABLY READ_ONLY NO 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 SESSION_VALUE 28800 GLOBAL_VALUE 28800 diff --git a/mysql-test/suite/versioning/common.opt b/mysql-test/suite/versioning/common.opt index 9baff80804d37..86f2c53c75343 100644 --- a/mysql-test/suite/versioning/common.opt +++ b/mysql-test/suite/versioning/common.opt @@ -1,2 +1,2 @@ ---versioning-hide=implicit +--system-versioning-hide=implicit --plugin-load=versioning diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result index c34856becd33c..59177645c160e 100644 --- a/mysql-test/suite/versioning/r/alter.result +++ b/mysql-test/suite/versioning/r/alter.result @@ -1,5 +1,5 @@ -select @@versioning_alter_history; -@@versioning_alter_history +select @@system_versioning_alter_history; +@@system_versioning_alter_history ERROR create table t( a int @@ -21,7 +21,7 @@ t CREATE TABLE `t` ( PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING 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; ERROR HY000: Not allowed for versioned `test`.`t`. Change to/from native versioning engine is prohibited. alter table t drop system versioning; @@ -30,7 +30,7 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -set versioning_alter_history= keep; +set system_versioning_alter_history= keep; alter table t add column trx_start bigint(20) unsigned generated always as row start, add column trx_end bigint(20) unsigned generated always as row end, @@ -503,9 +503,9 @@ Table Create Table t CREATE TABLE `t` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -set versioning_alter_history= SURVIVE; -ERROR 42000: Variable 'versioning_alter_history' can't be set to the value of 'SURVIVE' -set versioning_alter_history= DROP; -ERROR 42000: Variable 'versioning_alter_history' can't be set to the value of 'DROP' +set system_versioning_alter_history= SURVIVE; +ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'SURVIVE' +set system_versioning_alter_history= DROP; +ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'DROP' drop database test; create database test; diff --git a/mysql-test/suite/versioning/r/simple.result b/mysql-test/suite/versioning/r/simple.result index 344960e5ab3a9..8de6d24802c5e 100644 --- a/mysql-test/suite/versioning/r/simple.result +++ b/mysql-test/suite/versioning/r/simple.result @@ -48,23 +48,23 @@ dept for system_time from timestamp @ts_1 to timestamp @ts_2 d where d.dept_id = 10 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 -set statement versioning_asof_timestamp=@ts_0 for +set statement system_versioning_asof=@ts_0 for select * from emp e, dept d where d.dept_id = 10 and d.dept_id = e.dept_id; 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 where d.dept_id = 10 and d.dept_id = e.dept_id; 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 where d.dept_id = 10 and d.dept_id = e.dept_id; emp_id dept_id name salary dept_id name 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 where d.dept_id = 10 and d.dept_id = e.dept_id; diff --git a/mysql-test/suite/versioning/r/sysvars.result b/mysql-test/suite/versioning/r/sysvars.result index 8cb847554386e..c9f2ff0511129 100644 --- a/mysql-test/suite/versioning/r/sysvars.result +++ b/mysql-test/suite/versioning/r/sysvars.result @@ -1,116 +1,98 @@ create table t (a int) with system versioning; insert into t values (1); update t set a= 2; -show global variables like 'versioning_asof_timestamp'; +show global variables like 'system_versioning_asof'; Variable_name Value -versioning_asof_timestamp CURRENT -show variables like 'versioning_asof_timestamp'; +system_versioning_asof DEFAULT +show variables like 'system_versioning_asof'; Variable_name Value -versioning_asof_timestamp CURRENT +system_versioning_asof DEFAULT select * from t; a 2 -set versioning_asof_timestamp= '2031-1-1 0:0:0'; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= '2031-1-1 0:0:0'; +show variables like 'system_versioning_asof'; 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; a 2 -set versioning_asof_timestamp= '2011-1-1 0:0:0'; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= '2011-1-1 0:0:0'; +show variables like 'system_versioning_asof'; 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; a -set versioning_asof_timestamp= ALL; -show variables like 'versioning_asof_timestamp'; -Variable_name Value -versioning_asof_timestamp ALL -select * from t; -a -2 -1 -create view vt as select * from t; -select * from t; -a -2 -1 -drop view vt; -select * from (select * from t) as tt; -a -2 -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'; +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' -show global variables like 'versioning_asof_timestamp'; +show global variables like 'system_versioning_asof'; Variable_name Value -versioning_asof_timestamp 1911-11-11 11:11:11.111111 -set global versioning_asof_timestamp= '1900-01-01 00:00:00'; -show global variables like 'versioning_asof_timestamp'; +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 -versioning_asof_timestamp 1900-01-01 00:00:00.000000 -set global versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; +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' -show global variables like 'versioning_asof_timestamp'; +show global variables like 'system_versioning_asof'; 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 global versioning_asof_timestamp= @ts; -show global variables like 'versioning_asof_timestamp'; +set global system_versioning_asof= @ts; +show global variables like 'system_versioning_asof'; Variable_name Value -versioning_asof_timestamp 1900-01-01 00:00:00.000000 -set versioning_asof_timestamp= '1911-11-11 11:11:11.1111119'; +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' -show variables like 'versioning_asof_timestamp'; +show variables like 'system_versioning_asof'; Variable_name Value -versioning_asof_timestamp 1911-11-11 11:11:11.111111 -set versioning_asof_timestamp= '1900-01-01 00:00:00'; -show variables like 'versioning_asof_timestamp'; +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 -versioning_asof_timestamp 1900-01-01 00:00:00.000000 -set versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; +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' -show variables like 'versioning_asof_timestamp'; +show variables like 'system_versioning_asof'; 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 versioning_asof_timestamp= @ts; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= @ts; +show variables like 'system_versioning_asof'; Variable_name Value -versioning_asof_timestamp 1900-01-01 00:00:00.000000 -set global versioning_asof_timestamp= CURRENT; -set versioning_asof_timestamp= CURRENT; -show variables where variable_name = "versioning_hide"; +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 -versioning_hide IMPLICIT +system_versioning_hide IMPLICIT select * from t for system_time all; a 2 1 -set versioning_hide= AUTO; +set system_versioning_hide= AUTO; select * from t; a 2 @@ -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 2 TIMESTAMP TIMESTAMP 1 TIMESTAMP TIMESTAMP -set versioning_hide= NEVER; +set system_versioning_hide= NEVER; select * from t; a sys_trx_start sys_trx_end 2 TIMESTAMP TIMESTAMP -set versioning_hide= FULL; +set system_versioning_hide= FULL; create or replace table t ( x int, st timestamp(6) generated always as row start, @@ -153,4 +135,4 @@ select * from t for system_time all; x 2 drop table t; -set versioning_hide= IMPLICIT; +set system_versioning_hide= IMPLICIT; diff --git a/mysql-test/suite/versioning/t/alter.test b/mysql-test/suite/versioning/t/alter.test index bca824a7ebdd4..f1a4fde8e5639 100644 --- a/mysql-test/suite/versioning/t/alter.test +++ b/mysql-test/suite/versioning/t/alter.test @@ -1,4 +1,4 @@ -select @@versioning_alter_history; +select @@system_versioning_alter_history; create table t( a int @@ -18,7 +18,7 @@ alter table t engine innodb; alter table t drop system versioning; show create table t; -set versioning_alter_history= keep; +set system_versioning_alter_history= keep; --error ER_VERS_FIELD_WRONG_TYPE alter table t @@ -287,10 +287,10 @@ show create table t; ## These experimental options are now disabled --error ER_WRONG_VALUE_FOR_VAR -set versioning_alter_history= SURVIVE; +set system_versioning_alter_history= SURVIVE; --error ER_WRONG_VALUE_FOR_VAR -set versioning_alter_history= DROP; +set system_versioning_alter_history= DROP; if (0) { diff --git a/mysql-test/suite/versioning/t/cte.opt b/mysql-test/suite/versioning/t/cte.opt index e5abd94afebbb..2757b0f472a58 100644 --- a/mysql-test/suite/versioning/t/cte.opt +++ b/mysql-test/suite/versioning/t/cte.opt @@ -1,2 +1,2 @@ --plugin-load=versioning ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/mysql-test/suite/versioning/t/foreign.opt b/mysql-test/suite/versioning/t/foreign.opt index c1a585b67eb6d..51c33158c7ad7 100644 --- a/mysql-test/suite/versioning/t/foreign.opt +++ b/mysql-test/suite/versioning/t/foreign.opt @@ -1 +1 @@ ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/mysql-test/suite/versioning/t/partition.opt b/mysql-test/suite/versioning/t/partition.opt index 8608eed372b1b..51c33158c7ad7 100644 --- a/mysql-test/suite/versioning/t/partition.opt +++ b/mysql-test/suite/versioning/t/partition.opt @@ -1,2 +1 @@ ---partition ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index 76f2b5e145609..d8a5d143ddf9d 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -1,3 +1,4 @@ +-- source include/have_partition.inc -- source suite/versioning/common.inc ### check System Versioning and conventional partitioning diff --git a/mysql-test/suite/versioning/t/rpl.opt b/mysql-test/suite/versioning/t/rpl.opt index c1a585b67eb6d..51c33158c7ad7 100644 --- a/mysql-test/suite/versioning/t/rpl.opt +++ b/mysql-test/suite/versioning/t/rpl.opt @@ -1 +1 @@ ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/mysql-test/suite/versioning/t/simple.test b/mysql-test/suite/versioning/t/simple.test index f80ed605992c1..4a288b780ea76 100644 --- a/mysql-test/suite/versioning/t/simple.test +++ b/mysql-test/suite/versioning/t/simple.test @@ -50,22 +50,22 @@ select * from where d.dept_id = 10 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 where d.dept_id = 10 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 where d.dept_id = 10 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 where d.dept_id = 10 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 where d.dept_id = 10 and d.dept_id = e.dept_id; diff --git a/mysql-test/suite/versioning/t/sysvars.opt b/mysql-test/suite/versioning/t/sysvars.opt index c1a585b67eb6d..51c33158c7ad7 100644 --- a/mysql-test/suite/versioning/t/sysvars.opt +++ b/mysql-test/suite/versioning/t/sysvars.opt @@ -1 +1 @@ ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/mysql-test/suite/versioning/t/sysvars.test b/mysql-test/suite/versioning/t/sysvars.test index 87a237d1d42bc..ef8133fef6fd6 100644 --- a/mysql-test/suite/versioning/t/sysvars.test +++ b/mysql-test/suite/versioning/t/sysvars.test @@ -2,83 +2,73 @@ create table t (a int) with system versioning; insert into t values (1); update t set a= 2; -show global variables like 'versioning_asof_timestamp'; -show variables like 'versioning_asof_timestamp'; +show global variables like 'system_versioning_asof'; +show variables like 'system_versioning_asof'; select * from t; -set versioning_asof_timestamp= '2031-1-1 0:0:0'; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= '2031-1-1 0:0:0'; +show variables like 'system_versioning_asof'; select * from t; -set versioning_asof_timestamp= '2011-1-1 0:0:0'; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= '2011-1-1 0:0:0'; +show variables like 'system_versioning_asof'; 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 --error ER_WRONG_VALUE_FOR_VAR -set global versioning_asof_timestamp= 'alley'; +set global system_versioning_asof= 'alley'; --error ER_WRONG_VALUE_FOR_VAR -set global versioning_asof_timestamp= null; +set global system_versioning_asof= null; --error ER_WRONG_TYPE_FOR_VAR -set global versioning_asof_timestamp= 1; +set global system_versioning_asof= 1; --error ER_WRONG_TYPE_FOR_VAR -set global versioning_asof_timestamp= 1.1; +set global system_versioning_asof= 1.1; # session --error ER_WRONG_VALUE_FOR_VAR -set versioning_asof_timestamp= 'alley'; +set system_versioning_asof= 'alley'; --error ER_WRONG_VALUE_FOR_VAR -set versioning_asof_timestamp= null; +set system_versioning_asof= null; --error ER_WRONG_TYPE_FOR_VAR -set versioning_asof_timestamp= 1; +set system_versioning_asof= 1; --error ER_WRONG_TYPE_FOR_VAR -set versioning_asof_timestamp= 1.1; +set system_versioning_asof= 1.1; # global -set global versioning_asof_timestamp= '1911-11-11 11:11:11.1111119'; -show global variables like 'versioning_asof_timestamp'; +set global system_versioning_asof= '1911-11-11 11:11:11.1111119'; +show global variables like 'system_versioning_asof'; -set global versioning_asof_timestamp= '1900-01-01 00:00:00'; -show global variables like 'versioning_asof_timestamp'; +set global system_versioning_asof= '1900-01-01 00:00:00'; +show global variables like 'system_versioning_asof'; -set global versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; -show global variables like 'versioning_asof_timestamp'; +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 versioning_asof_timestamp= @ts; -show global variables like 'versioning_asof_timestamp'; +set global system_versioning_asof= @ts; +show global variables like 'system_versioning_asof'; # session -set versioning_asof_timestamp= '1911-11-11 11:11:11.1111119'; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= '1911-11-11 11:11:11.1111119'; +show variables like 'system_versioning_asof'; -set versioning_asof_timestamp= '1900-01-01 00:00:00'; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= '1900-01-01 00:00:00'; +show variables like 'system_versioning_asof'; -set versioning_asof_timestamp= timestamp'1911-11-11 11:11:11.1111119'; -show variables like 'versioning_asof_timestamp'; +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 versioning_asof_timestamp= @ts; -show variables like 'versioning_asof_timestamp'; +set system_versioning_asof= @ts; +show variables like 'system_versioning_asof'; -set global versioning_asof_timestamp= CURRENT; -set versioning_asof_timestamp= CURRENT; +set global system_versioning_asof= DEFAULT; +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; -set versioning_hide= AUTO; +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/ @@ -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/ 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/ select * from t; -set versioning_hide= FULL; +set system_versioning_hide= FULL; create or replace table t ( x int, st timestamp(6) generated always as row start, @@ -108,4 +98,4 @@ select * from t; select * from t for system_time all; drop table t; -set versioning_hide= IMPLICIT; +set system_versioning_hide= IMPLICIT; diff --git a/mysql-test/suite/versioning/t/truncate.opt b/mysql-test/suite/versioning/t/truncate.opt index c1a585b67eb6d..51c33158c7ad7 100644 --- a/mysql-test/suite/versioning/t/truncate.opt +++ b/mysql-test/suite/versioning/t/truncate.opt @@ -1 +1 @@ ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/mysql-test/suite/versioning/t/view.opt b/mysql-test/suite/versioning/t/view.opt index c1a585b67eb6d..51c33158c7ad7 100644 --- a/mysql-test/suite/versioning/t/view.opt +++ b/mysql-test/suite/versioning/t/view.opt @@ -1 +1 @@ ---versioning-hide=implicit +--system-versioning-hide=implicit diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 07d07d3f6d220..c010fffbf67c9 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -23,7 +23,7 @@ set sql_mode=''; set @orig_storage_engine=@@storage_engine; 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 @innodb_or_myisam=IF(@have_innodb <> 0, 'InnoDB', 'MyISAM'); diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 790891410523c..bad7c786f461b 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7852,7 +7852,7 @@ WARN_VERS_PART_NON_HISTORICAL eng "Partition %`s contains non-historical data" 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 eng "Not allowed for versioned %`s.%`s. Change to/from native versioning engine is prohibited." diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index adef93ef20584..23dcf7cc89ad1 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -387,19 +387,19 @@ static Sys_var_charptr Sys_my_bind_addr( READ_ONLY GLOBAL_VAR(my_bind_addr_str), CMD_LINE(REQUIRED_ARG), 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( - "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, Sys_var_vers_asof::asof_keywords, DEFAULT(FOR_SYSTEM_TIME_UNSPECIFIED)); 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)); static const char *vers_hide_keywords[]= {"AUTO", "IMPLICIT", "FULL", "NEVER", NULL}; 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; " "IMPLICIT: hide implicit system fields in all queries; " "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( vers_hide_keywords, DEFAULT(VERS_HIDE_AUTO)); 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", SESSION_VAR(vers_innodb_algorithm_simple), CMD_LINE(OPT_ARG), DEFAULT(TRUE)); static const char *vers_alter_history_keywords[]= {"ERROR", "KEEP",/* "SURVIVE", "DROP",*/ NULL}; 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 */ "KEEP: Keep historical system rows and subject them to ALTER; " /*"SURVIVE: Keep historical system rows intact; "