File tree Expand file tree Collapse file tree 9 files changed +40
-32
lines changed
mysql-test/suite/versioning Expand file tree Collapse file tree 9 files changed +40
-32
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,11 @@ ancestors
33
33
as
34
34
(
35
35
select e.emp_id, e.name, e.mgr, e.salary
36
- from emp as e for system_time as of timestamp @ts_1
36
+ from emp for system_time as of timestamp @ts_1 as e
37
37
where name = 'bill'
38
38
union
39
39
select e.emp_id, e.name, e.mgr, e.salary
40
- from emp as e for system_time as of timestamp @ts_1,
40
+ from emp for system_time as of timestamp @ts_1 as e,
41
41
ancestors as a
42
42
where e.mgr = a.emp_id
43
43
)
@@ -51,11 +51,11 @@ ancestors
51
51
as
52
52
(
53
53
select e.emp_id, e.name, e.mgr, e.salary
54
- from emp as e for system_time as of timestamp @ts_2
54
+ from emp for system_time as of timestamp @ts_2 as e
55
55
where name = 'bill'
56
56
union
57
57
select e.emp_id, e.name, e.mgr, e.salary
58
- from emp as e for system_time as of timestamp @ts_2,
58
+ from emp for system_time as of timestamp @ts_2 as e ,
59
59
ancestors as a
60
60
where e.mgr = a.emp_id
61
61
)
Original file line number Diff line number Diff line change @@ -91,12 +91,14 @@ ancestors
91
91
as
92
92
(
93
93
select e.emp_id, e.name, e.mgr
94
- from emp as e for system_time as of timestamp @ts
94
+ from emp as e
95
95
where name = 'bill'
96
- union
96
+ system_time as of timestamp @ts
97
+ union
97
98
select ee.emp_id, ee.name, ee.mgr
98
- from emp as ee for system_time as of timestamp @ts , ancestors as a for system_time as of timestamp @ts
99
+ from emp as ee, ancestors as a
99
100
where ee.mgr = a.emp_id
101
+ system_time as of timestamp @ts
100
102
)
101
103
select * from ancestors;
102
104
emp_id name mgr
@@ -109,12 +111,14 @@ ancestors
109
111
as
110
112
(
111
113
select e.emp_id, e.name, e.mgr
112
- from emp as e for system_time as of timestamp @ts
114
+ from emp as e
113
115
where name = 'bill'
116
+ system_time as of timestamp @ts
114
117
union
115
118
select ee.emp_id, ee.name, ee.mgr
116
- from emp as ee for system_time as of timestamp @ts , ancestors as a for system_time as of timestamp @ts
119
+ from emp as ee, ancestors as a
117
120
where ee.mgr = a.emp_id
121
+ system_time as of timestamp @ts
118
122
)
119
123
select * from ancestors";
120
124
prepare stmt from @tmp;
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ declare continue handler for not found set cur_done = true;
8
8
set @tmp= concat('
9
9
create or replace temporary table
10
10
cur_tmp as
11
- select vtmd.archive_name from ', vtmd_name, ' as vtmd
12
- for system_time all
11
+ select vtmd.archive_name from ', vtmd_name, '
12
+ for system_time all as vtmd
13
13
where vtmd.archive_name is not null
14
14
group by vtmd.archive_name');
15
15
prepare stmt from @tmp; execute stmt; drop prepare stmt;
29
29
set @tmp= concat('
30
30
create or replace temporary table
31
31
tmp_vtmd with system versioning as
32
- select * from ', vtmd_name, ' as vtmd
33
- for system_time all');
32
+ select * from ', vtmd_name, '
33
+ for system_time all as vtmd ');
34
34
prepare stmt from @tmp; execute stmt; drop prepare stmt;
35
35
set @inf= 0xFFFFFFFFFFFFFFFF + 0;
36
36
set @start= null;
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ declare continue handler for not found set cur_done = true;
8
8
set @tmp= concat('
9
9
create or replace temporary table
10
10
cur_tmp as
11
- select vtmd.archive_name from ', vtmd_name, ' as vtmd
12
- for system_time all
11
+ select vtmd.archive_name from ', vtmd_name, '
12
+ for system_time all as vtmd
13
13
where vtmd.archive_name is not null
14
14
group by vtmd.archive_name');
15
15
prepare stmt from @tmp; execute stmt; drop prepare stmt;
Original file line number Diff line number Diff line change @@ -39,11 +39,11 @@ ancestors
39
39
as
40
40
(
41
41
select e.emp_id, e.name, e.mgr, e.salary
42
- from emp as e for system_time as of timestamp @ts_1
42
+ from emp for system_time as of timestamp @ts_1 as e
43
43
where name = 'bill'
44
44
union
45
45
select e.emp_id, e.name, e.mgr, e.salary
46
- from emp as e for system_time as of timestamp @ts_1,
46
+ from emp for system_time as of timestamp @ts_1 as e,
47
47
ancestors as a
48
48
where e.mgr = a.emp_id
49
49
)
@@ -55,11 +55,11 @@ ancestors
55
55
as
56
56
(
57
57
select e.emp_id, e.name, e.mgr, e.salary
58
- from emp as e for system_time as of timestamp @ts_2
58
+ from emp for system_time as of timestamp @ts_2 as e
59
59
where name = 'bill'
60
60
union
61
61
select e.emp_id, e.name, e.mgr, e.salary
62
- from emp as e for system_time as of timestamp @ts_2,
62
+ from emp for system_time as of timestamp @ts_2 as e ,
63
63
ancestors as a
64
64
where e.mgr = a.emp_id
65
65
)
Original file line number Diff line number Diff line change @@ -62,12 +62,14 @@ ancestors
62
62
as
63
63
(
64
64
select e.emp_id, e.name, e.mgr
65
- from emp as e for system_time as of timestamp @ts
65
+ from emp as e
66
66
where name = 'bill'
67
+ system_time as of timestamp @ts
67
68
union
68
69
select ee.emp_id, ee.name, ee.mgr
69
- from emp as ee for system_time as of timestamp @ts , ancestors as a for system_time as of timestamp @ts
70
+ from emp as ee, ancestors as a
70
71
where ee.mgr = a.emp_id
72
+ system_time as of timestamp @ts
71
73
)
72
74
select * from ancestors;
73
75
set @tmp= "
@@ -76,12 +78,14 @@ ancestors
76
78
as
77
79
(
78
80
select e.emp_id, e.name, e.mgr
79
- from emp as e for system_time as of timestamp @ts
81
+ from emp as e
80
82
where name = 'bill'
83
+ system_time as of timestamp @ts
81
84
union
82
85
select ee.emp_id, ee.name, ee.mgr
83
- from emp as ee for system_time as of timestamp @ts , ancestors as a for system_time as of timestamp @ts
86
+ from emp as ee, ancestors as a
84
87
where ee.mgr = a.emp_id
88
+ system_time as of timestamp @ts
85
89
)
86
90
select * from ancestors";
87
91
prepare stmt from @tmp; execute stmt; drop prepare stmt;
Original file line number Diff line number Diff line change 11
11
set @tmp= concat('
12
12
create or replace temporary table
13
13
cur_tmp as
14
- select vtmd.archive_name from ', vtmd_name, ' as vtmd
15
- for system_time all
14
+ select vtmd.archive_name from ', vtmd_name, '
15
+ for system_time all as vtmd
16
16
where vtmd.archive_name is not null
17
17
group by vtmd.archive_name');
18
18
prepare stmt from @tmp; execute stmt; drop prepare stmt;
37
37
set @tmp= concat('
38
38
create or replace temporary table
39
39
tmp_vtmd with system versioning as
40
- select * from ', vtmd_name, ' as vtmd
41
- for system_time all');
40
+ select * from ', vtmd_name, '
41
+ for system_time all as vtmd ');
42
42
prepare stmt from @tmp; execute stmt; drop prepare stmt;
43
43
44
44
set @inf= 0xFFFFFFFFFFFFFFFF + 0;
Original file line number Diff line number Diff line change 10
10
set @tmp= concat('
11
11
create or replace temporary table
12
12
cur_tmp as
13
- select vtmd.archive_name from ', vtmd_name, ' as vtmd
14
- for system_time all
13
+ select vtmd.archive_name from ', vtmd_name, '
14
+ for system_time all as vtmd
15
15
where vtmd.archive_name is not null
16
16
group by vtmd.archive_name');
17
17
prepare stmt from @tmp; execute stmt; drop prepare stmt;
Original file line number Diff line number Diff line change @@ -11334,17 +11334,17 @@ table_primary_ident:
11334
11334
SELECT_LEX *sel= Select;
11335
11335
sel->table_join_options= 0;
11336
11336
}
11337
- table_ident opt_use_partition opt_table_alias opt_key_definition opt_for_system_time_clause
11337
+ table_ident opt_use_partition opt_for_system_time_clause opt_table_alias opt_key_definition
11338
11338
{
11339
- if (!($$= Select->add_table_to_list(thd, $2, $4 ,
11339
+ if (!($$= Select->add_table_to_list(thd, $2, $5 ,
11340
11340
Select->get_table_join_options(),
11341
11341
YYPS->m_lock_type,
11342
11342
YYPS->m_mdl_type,
11343
11343
Select->pop_index_hints(),
11344
11344
$3)))
11345
11345
MYSQL_YYABORT;
11346
11346
Select->add_joined_table($$);
11347
- if ($6 )
11347
+ if ($4 )
11348
11348
$$->vers_conditions= Lex->vers_conditions;
11349
11349
}
11350
11350
;
You can’t perform that action at this time.
0 commit comments