Skip to content

Commit 4624e56

Browse files
committed
System Versioning 1.0 pre6
Merge remote-tracking branch 'mariadb/bb-10.3-temporal-serg' into trunk
2 parents 70d7672 + 84e14bf commit 4624e56

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+528
-541
lines changed

mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -4897,6 +4897,76 @@ NUMERIC_BLOCK_SIZE 1
48974897
ENUM_VALUE_LIST NULL
48984898
READ_ONLY NO
48994899
COMMAND_LINE_ARGUMENT REQUIRED
4900+
VARIABLE_NAME SYSTEM_VERSIONING_ALTER_HISTORY
4901+
SESSION_VALUE ERROR
4902+
GLOBAL_VALUE ERROR
4903+
GLOBAL_VALUE_ORIGIN COMPILE-TIME
4904+
DEFAULT_VALUE ERROR
4905+
VARIABLE_SCOPE SESSION
4906+
VARIABLE_TYPE ENUM
4907+
VARIABLE_COMMENT Versioning ALTER TABLE mode. ERROR: Fail ALTER with error; KEEP: Keep historical system rows and subject them to ALTER;
4908+
NUMERIC_MIN_VALUE NULL
4909+
NUMERIC_MAX_VALUE NULL
4910+
NUMERIC_BLOCK_SIZE NULL
4911+
ENUM_VALUE_LIST ERROR,KEEP
4912+
READ_ONLY NO
4913+
COMMAND_LINE_ARGUMENT REQUIRED
4914+
VARIABLE_NAME SYSTEM_VERSIONING_ASOF
4915+
SESSION_VALUE DEFAULT
4916+
GLOBAL_VALUE DEFAULT
4917+
GLOBAL_VALUE_ORIGIN COMPILE-TIME
4918+
DEFAULT_VALUE DEFAULT
4919+
VARIABLE_SCOPE SESSION
4920+
VARIABLE_TYPE VARCHAR
4921+
VARIABLE_COMMENT Default value for the FOR SYSTEM_TIME AS OF clause
4922+
NUMERIC_MIN_VALUE NULL
4923+
NUMERIC_MAX_VALUE NULL
4924+
NUMERIC_BLOCK_SIZE NULL
4925+
ENUM_VALUE_LIST DEFAULT
4926+
READ_ONLY NO
4927+
COMMAND_LINE_ARGUMENT NULL
4928+
VARIABLE_NAME SYSTEM_VERSIONING_FORCE
4929+
SESSION_VALUE OFF
4930+
GLOBAL_VALUE OFF
4931+
GLOBAL_VALUE_ORIGIN COMPILE-TIME
4932+
DEFAULT_VALUE OFF
4933+
VARIABLE_SCOPE SESSION
4934+
VARIABLE_TYPE BOOLEAN
4935+
VARIABLE_COMMENT Force system versioning for all created tables
4936+
NUMERIC_MIN_VALUE NULL
4937+
NUMERIC_MAX_VALUE NULL
4938+
NUMERIC_BLOCK_SIZE NULL
4939+
ENUM_VALUE_LIST OFF,ON
4940+
READ_ONLY NO
4941+
COMMAND_LINE_ARGUMENT OPTIONAL
4942+
VARIABLE_NAME SYSTEM_VERSIONING_HIDE
4943+
SESSION_VALUE AUTO
4944+
GLOBAL_VALUE AUTO
4945+
GLOBAL_VALUE_ORIGIN COMPILE-TIME
4946+
DEFAULT_VALUE AUTO
4947+
VARIABLE_SCOPE SESSION
4948+
VARIABLE_TYPE ENUM
4949+
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
4950+
NUMERIC_MIN_VALUE NULL
4951+
NUMERIC_MAX_VALUE NULL
4952+
NUMERIC_BLOCK_SIZE NULL
4953+
ENUM_VALUE_LIST AUTO,IMPLICIT,FULL,NEVER
4954+
READ_ONLY NO
4955+
COMMAND_LINE_ARGUMENT REQUIRED
4956+
VARIABLE_NAME SYSTEM_VERSIONING_INNODB_ALGORITHM_SIMPLE
4957+
SESSION_VALUE ON
4958+
GLOBAL_VALUE ON
4959+
GLOBAL_VALUE_ORIGIN COMPILE-TIME
4960+
DEFAULT_VALUE ON
4961+
VARIABLE_SCOPE SESSION
4962+
VARIABLE_TYPE BOOLEAN
4963+
VARIABLE_COMMENT Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES
4964+
NUMERIC_MIN_VALUE NULL
4965+
NUMERIC_MAX_VALUE NULL
4966+
NUMERIC_BLOCK_SIZE NULL
4967+
ENUM_VALUE_LIST OFF,ON
4968+
READ_ONLY NO
4969+
COMMAND_LINE_ARGUMENT OPTIONAL
49004970
VARIABLE_NAME TABLE_DEFINITION_CACHE
49014971
SESSION_VALUE NULL
49024972
GLOBAL_VALUE 400
@@ -5373,76 +5443,6 @@ NUMERIC_BLOCK_SIZE NULL
53735443
ENUM_VALUE_LIST NEVER,COMPLEMENTARY,PREFERABLY
53745444
READ_ONLY NO
53755445
COMMAND_LINE_ARGUMENT REQUIRED
5376-
VARIABLE_NAME VERSIONING_ALTER_HISTORY
5377-
SESSION_VALUE ERROR
5378-
GLOBAL_VALUE ERROR
5379-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
5380-
DEFAULT_VALUE ERROR
5381-
VARIABLE_SCOPE SESSION
5382-
VARIABLE_TYPE ENUM
5383-
VARIABLE_COMMENT Versioning ALTER TABLE mode. ERROR: Fail ALTER with error; KEEP: Keep historical system rows and subject them to ALTER;
5384-
NUMERIC_MIN_VALUE NULL
5385-
NUMERIC_MAX_VALUE NULL
5386-
NUMERIC_BLOCK_SIZE NULL
5387-
ENUM_VALUE_LIST ERROR,KEEP
5388-
READ_ONLY NO
5389-
COMMAND_LINE_ARGUMENT REQUIRED
5390-
VARIABLE_NAME VERSIONING_ASOF_TIMESTAMP
5391-
SESSION_VALUE CURRENT
5392-
GLOBAL_VALUE CURRENT
5393-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
5394-
DEFAULT_VALUE CURRENT
5395-
VARIABLE_SCOPE SESSION
5396-
VARIABLE_TYPE VARCHAR
5397-
VARIABLE_COMMENT Default AS OF value for versioned queries
5398-
NUMERIC_MIN_VALUE NULL
5399-
NUMERIC_MAX_VALUE NULL
5400-
NUMERIC_BLOCK_SIZE NULL
5401-
ENUM_VALUE_LIST CURRENT,ALL
5402-
READ_ONLY NO
5403-
COMMAND_LINE_ARGUMENT NULL
5404-
VARIABLE_NAME VERSIONING_FORCE
5405-
SESSION_VALUE OFF
5406-
GLOBAL_VALUE OFF
5407-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
5408-
DEFAULT_VALUE OFF
5409-
VARIABLE_SCOPE SESSION
5410-
VARIABLE_TYPE BOOLEAN
5411-
VARIABLE_COMMENT Force system versioning for all created tables
5412-
NUMERIC_MIN_VALUE NULL
5413-
NUMERIC_MAX_VALUE NULL
5414-
NUMERIC_BLOCK_SIZE NULL
5415-
ENUM_VALUE_LIST OFF,ON
5416-
READ_ONLY NO
5417-
COMMAND_LINE_ARGUMENT OPTIONAL
5418-
VARIABLE_NAME VERSIONING_HIDE
5419-
SESSION_VALUE AUTO
5420-
GLOBAL_VALUE AUTO
5421-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
5422-
DEFAULT_VALUE AUTO
5423-
VARIABLE_SCOPE SESSION
5424-
VARIABLE_TYPE ENUM
5425-
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
5426-
NUMERIC_MIN_VALUE NULL
5427-
NUMERIC_MAX_VALUE NULL
5428-
NUMERIC_BLOCK_SIZE NULL
5429-
ENUM_VALUE_LIST AUTO,IMPLICIT,FULL,NEVER
5430-
READ_ONLY NO
5431-
COMMAND_LINE_ARGUMENT REQUIRED
5432-
VARIABLE_NAME VERSIONING_INNODB_ALGORITHM_SIMPLE
5433-
SESSION_VALUE ON
5434-
GLOBAL_VALUE ON
5435-
GLOBAL_VALUE_ORIGIN COMPILE-TIME
5436-
DEFAULT_VALUE ON
5437-
VARIABLE_SCOPE SESSION
5438-
VARIABLE_TYPE BOOLEAN
5439-
VARIABLE_COMMENT Use simple algorithm of timestamp handling in InnoDB instead of TRX_SEES
5440-
NUMERIC_MIN_VALUE NULL
5441-
NUMERIC_MAX_VALUE NULL
5442-
NUMERIC_BLOCK_SIZE NULL
5443-
ENUM_VALUE_LIST OFF,ON
5444-
READ_ONLY NO
5445-
COMMAND_LINE_ARGUMENT OPTIONAL
54465446
VARIABLE_NAME WAIT_TIMEOUT
54475447
SESSION_VALUE 28800
54485448
GLOBAL_VALUE 28800
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
--versioning-hide=implicit
1+
--system-versioning-hide=implicit
22
--plugin-load=versioning

mysql-test/suite/versioning/r/alter.result

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
select @@versioning_alter_history;
2-
@@versioning_alter_history
1+
select @@system_versioning_alter_history;
2+
@@system_versioning_alter_history
33
ERROR
44
create table t(
55
a int
@@ -21,7 +21,7 @@ t CREATE TABLE `t` (
2121
PERIOD FOR SYSTEM_TIME (`sys_trx_start`, `sys_trx_end`)
2222
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
2323
alter table t add column y int;
24-
ERROR HY000: Not allowed for versioned `test`.`t`. Change `versioning_alter_history` to proceed with ALTER.
24+
ERROR HY000: Not allowed for versioned `test`.`t`. Change @@system_versioning_alter_history to proceed with ALTER.
2525
alter table t engine innodb;
2626
ERROR HY000: Not allowed for versioned `test`.`t`. Change to/from native versioning engine is prohibited.
2727
alter table t drop system versioning;
@@ -30,7 +30,7 @@ Table Create Table
3030
t CREATE TABLE `t` (
3131
`a` int(11) DEFAULT NULL
3232
) ENGINE=MyISAM DEFAULT CHARSET=latin1
33-
set versioning_alter_history= keep;
33+
set system_versioning_alter_history= keep;
3434
alter table t
3535
add column trx_start bigint(20) unsigned generated always as row start,
3636
add column trx_end bigint(20) unsigned generated always as row end,
@@ -398,6 +398,16 @@ t CREATE TABLE `t` (
398398
) ENGINE=InnoDB DEFAULT CHARSET=latin1
399399
call verify_vtq;
400400
No A B C D
401+
create or replace table t (a int);
402+
insert t values (1),(2),(3),(4);
403+
alter table t add b int auto_increment null unique;
404+
select * from t;
405+
a b
406+
1 1
407+
2 2
408+
3 3
409+
4 4
410+
drop table t;
401411
create or replace table t (a int) with system versioning engine=innodb;
402412
insert into t values (1), (2), (3);
403413
delete from t where a<3;
@@ -493,10 +503,10 @@ Table Create Table
493503
t CREATE TABLE `t` (
494504
`a` int(11) DEFAULT NULL
495505
) ENGINE=MyISAM DEFAULT CHARSET=latin1
496-
set versioning_alter_history= SURVIVE;
497-
ERROR 42000: Variable 'versioning_alter_history' can't be set to the value of 'SURVIVE'
498-
set versioning_alter_history= DROP;
499-
ERROR 42000: Variable 'versioning_alter_history' can't be set to the value of 'DROP'
506+
set system_versioning_alter_history= SURVIVE;
507+
ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'SURVIVE'
508+
set system_versioning_alter_history= DROP;
509+
ERROR 42000: Variable 'system_versioning_alter_history' can't be set to the value of 'DROP'
500510
create or replace table t (a int) with system versioning;
501511
alter table t add system versioning;
502512
ERROR HY000: Table `t` is already system-versioned table

mysql-test/suite/versioning/r/cte.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ emp_id name mgr address
119119
2 bill 1 New York
120120
3 kate 1 London
121121
4 john 1 Paris
122-
with ancestors as (select * from emp natural join addr where 1 for system_time all) select * from ancestors;
122+
with ancestors as (select * from (select * from emp natural join addr) for system_time all as t) select * from ancestors;
123123
emp_id name mgr address
124124
1 bill 0 Moscow
125125
2 bill 1 New York
126126
3 kate 1 London
127127
4 john 1 Paris
128-
select * from emp natural join addr where 1 for system_time all;
128+
select * from (select * from emp natural join addr) for system_time all as t;
129129
emp_id name mgr address
130130
1 bill 0 Moscow
131131
2 bill 1 New York

mysql-test/suite/versioning/r/derived.result

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,11 @@ ancestors
9191
as
9292
(
9393
select e.emp_id, e.name, e.mgr
94-
from emp as e
94+
from emp for system_time as of timestamp @ts as e
9595
where name = 'bill'
96-
for system_time as of timestamp @ts
97-
union
96+
union
9897
select ee.emp_id, ee.name, ee.mgr
99-
from emp
100-
for system_time as of timestamp @ts as ee,
98+
from emp for system_time as of timestamp @ts as ee,
10199
ancestors as a
102100
where ee.mgr = a.emp_id
103101
)
@@ -112,9 +110,8 @@ ancestors
112110
as
113111
(
114112
select e.emp_id, e.name, e.mgr
115-
from emp as e
113+
from emp for system_time as of timestamp @ts as e
116114
where name = 'bill'
117-
for system_time as of timestamp @ts
118115
union
119116
select ee.emp_id, ee.name, ee.mgr
120117
from emp for system_time as of timestamp @ts as ee,
@@ -170,7 +167,7 @@ select * from (select * from vt1, t2) as s0;
170167
x y
171168
1 10
172169
### SYSTEM_TIME clash
173-
select * from (select * from t1 for system_time all) dt0 for system_time all;
170+
select * from (select * from t1 for system_time all) for system_time all as dt0;
174171
ERROR HY000: SYSTEM_TIME is not allowed outside historical `dt0`
175172
select * from vt1 for system_time all;
176173
ERROR HY000: SYSTEM_TIME is not allowed outside historical `vt1`

mysql-test/suite/versioning/r/optimized.result

Lines changed: 6 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ a b
2525
3 NULL
2626
Warnings:
2727
Warning 4112 Attempt to read unversioned field `b` in historical query
28-
select count(*) from t group by b for system_time as of timestamp now(6);
28+
select count(*) from t for system_time as of timestamp now(6) group by b;
2929
count(*)
3030
2
3131
Warnings:
@@ -44,41 +44,10 @@ a b
4444
Warnings:
4545
Warning 4112 Attempt to read unversioned field `b` in historical query
4646
Warning 4112 Attempt to read unversioned field `b` in historical query
47-
select * from t group by a having a=2 for system_time as of timestamp now(6);
48-
a b
49-
Warnings:
50-
Warning 4112 Attempt to read unversioned field `b` in historical query
51-
select * from t group by b having b=2 for system_time as of timestamp now(6);
47+
select * from t for system_time as of timestamp now(6) group by a having a=2;
5248
a b
5349
Warnings:
5450
Warning 4112 Attempt to read unversioned field `b` in historical query
55-
select a from t where b=2 for system_time as of timestamp now(6);
56-
a
57-
Warnings:
58-
Warning 4112 Attempt to read unversioned field `b` in historical query
59-
select a from t where b=NULL for system_time as of timestamp now(6);
60-
a
61-
Warnings:
62-
Warning 4112 Attempt to read unversioned field `b` in historical query
63-
select a from t where b is NULL for system_time as of timestamp now(6);
64-
a
65-
1
66-
3
67-
Warnings:
68-
Warning 4112 Attempt to read unversioned field `b` in historical query
69-
select count(*), b from t group by b having b=NULL for system_time as of timestamp now(6);
70-
count(*) b
71-
Warnings:
72-
Warning 4112 Attempt to read unversioned field `b` in historical query
73-
select a, b from t;
74-
a b
75-
1 2
76-
3 4
77-
select count(*) from t for system_time as of timestamp now(6) group by b;
78-
count(*)
79-
2
80-
Warnings:
81-
Warning 4112 Attempt to read unversioned field `b` in historical query
8251
select * from t for system_time as of timestamp now(6) group by b having b=2;
8352
a b
8453
Warnings:
@@ -101,6 +70,10 @@ select count(*), b from t for system_time as of timestamp now(6) group by b havi
10170
count(*) b
10271
Warnings:
10372
Warning 4112 Attempt to read unversioned field `b` in historical query
73+
select a, b from t;
74+
a b
75+
1 2
76+
3 4
10477
create or replace table t (
10578
a int,
10679
b int not null without system versioning

0 commit comments

Comments
 (0)