Skip to content

Commit b85efdc

Browse files
vuvovamidenok
authored andcommitted
rename system_time columns
sys_trx_start -> row_start sys_trx_end -> row_end
1 parent cf1e5be commit b85efdc

32 files changed

+223
-223
lines changed

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

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -118,29 +118,29 @@ t CREATE TABLE `t` (
118118
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
119119
create or replace table t (
120120
a int,
121-
sys_trx_start timestamp(6) as row start invisible,
122-
sys_trx_end timestamp(6) as row end invisible,
123-
period for system_time(sys_trx_start, sys_trx_end))
121+
row_start timestamp(6) as row start invisible,
122+
row_end timestamp(6) as row end invisible,
123+
period for system_time(row_start, row_end))
124124
with system versioning;
125125
select * from t for system_time all;
126126
a
127-
alter table t drop column sys_trx_start;
128-
alter table t drop column sys_trx_end;
127+
alter table t drop column row_start;
128+
alter table t drop column row_end;
129129
select * from t for system_time all;
130130
a
131-
alter table t drop column sys_trx_start;
132-
ERROR 42000: Can't DROP COLUMN `sys_trx_start`; check that it exists
133-
alter table t drop column sys_trx_end;
134-
ERROR 42000: Can't DROP COLUMN `sys_trx_end`; check that it exists
131+
alter table t drop column row_start;
132+
ERROR 42000: Can't DROP COLUMN `row_start`; check that it exists
133+
alter table t drop column row_end;
134+
ERROR 42000: Can't DROP COLUMN `row_end`; check that it exists
135135
create or replace table t (
136136
a int,
137-
sys_trx_start timestamp(6) as row start invisible,
138-
sys_trx_end timestamp(6) as row end invisible,
139-
period for system_time(sys_trx_start, sys_trx_end))
137+
row_start timestamp(6) as row start invisible,
138+
row_end timestamp(6) as row end invisible,
139+
period for system_time(row_start, row_end))
140140
with system versioning;
141141
select * from t for system_time all;
142142
a
143-
alter table t drop column sys_trx_start, drop column sys_trx_end;
143+
alter table t drop column row_start, drop column row_end;
144144
select * from t for system_time all;
145145
a
146146
create or replace table t(
@@ -172,10 +172,10 @@ a
172172
3
173173
2
174174
1
175-
select sys_trx_start from t where a=3 into @tm;
175+
select row_start from t where a=3 into @tm;
176176
alter table t add column b int;
177-
select @tm=sys_trx_start from t where a=3;
178-
@tm=sys_trx_start
177+
select @tm=row_start from t where a=3;
178+
@tm=row_start
179179
1
180180
show create table t;
181181
Table Create Table
@@ -374,31 +374,31 @@ a b
374374
4 2
375375
create or replace table t (
376376
a int,
377-
sys_trx_start timestamp(6) as row start invisible,
378-
sys_trx_end timestamp(6) as row end invisible,
379-
period for system_time(sys_trx_start, sys_trx_end)
377+
row_start timestamp(6) as row start invisible,
378+
row_end timestamp(6) as row end invisible,
379+
period for system_time(row_start, row_end)
380380
) with system versioning;
381-
alter table t change column sys_trx_start asdf timestamp(6);
382-
ERROR HY000: Can not change system versioning field `sys_trx_start`
381+
alter table t change column row_start asdf timestamp(6);
382+
ERROR HY000: Can not change system versioning field `row_start`
383383
insert into t values (1);
384-
alter table t modify column sys_trx_start bigint unsigned;
385-
ERROR HY000: Can not change system versioning field `sys_trx_start`
384+
alter table t modify column row_start bigint unsigned;
385+
ERROR HY000: Can not change system versioning field `row_start`
386386
create or replace table t (
387387
a int,
388-
sys_trx_start timestamp(6) as row start invisible,
389-
sys_trx_end timestamp(6) as row end invisible,
390-
period for system_time(sys_trx_start, sys_trx_end)
388+
row_start timestamp(6) as row start invisible,
389+
row_end timestamp(6) as row end invisible,
390+
period for system_time(row_start, row_end)
391391
) with system versioning;
392392
select * from t;
393393
a
394394
alter table t drop system versioning;
395-
ERROR HY000: System versioning field `sys_trx_start` exists
396-
alter table t drop column sys_trx_start;
395+
ERROR HY000: System versioning field `row_start` exists
396+
alter table t drop column row_start;
397397
select * from t;
398398
a
399399
alter table t drop system versioning;
400-
ERROR HY000: System versioning field `sys_trx_end` exists
401-
alter table t drop column sys_trx_end;
400+
ERROR HY000: System versioning field `row_end` exists
401+
alter table t drop column row_end;
402402
select * from t;
403403
a
404404
alter table t drop system versioning;
@@ -450,20 +450,20 @@ alter table t drop column a;
450450
ERROR HY000: Table `t` must have at least one versioned column
451451
alter table t drop column a, drop column a;
452452
ERROR 42000: Can't DROP COLUMN `a`; check that it exists
453-
create or replace table t1 (sys_trx_start int);
453+
create or replace table t1 (row_start int);
454454
alter table t1 with system versioning;
455-
ERROR 42S21: Duplicate column name 'sys_trx_start'
456-
create or replace table t1 (sys_trx_end int);
455+
ERROR 42S21: Duplicate column name 'row_start'
456+
create or replace table t1 (row_end int);
457457
alter table t1 with system versioning;
458-
ERROR 42S21: Duplicate column name 'sys_trx_end'
459-
create or replace table t1 (a int, sys_trx_start int) with system versioning;
460-
ERROR 42S21: Duplicate column name 'sys_trx_start'
458+
ERROR 42S21: Duplicate column name 'row_end'
459+
create or replace table t1 (a int, row_start int) with system versioning;
460+
ERROR 42S21: Duplicate column name 'row_start'
461461
create or replace table t1 (a int) with system versioning;
462462
set statement system_versioning_alter_history=keep for
463-
alter table t1 add column sys_trx_start int;
464-
ERROR 42S21: Duplicate column name 'sys_trx_start'
463+
alter table t1 add column row_start int;
464+
ERROR 42S21: Duplicate column name 'row_start'
465465
set statement system_versioning_alter_history=keep for
466-
alter table t1 add column sys_trx_start timestamp(6);
467-
ERROR 42S21: Duplicate column name 'sys_trx_start'
466+
alter table t1 add column row_start timestamp(6);
467+
ERROR 42S21: Duplicate column name 'row_start'
468468
drop database test;
469469
create database test;

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ t3 CREATE TABLE `t3` (
211211
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
212212
## For versioned table
213213
insert into t1 values (1);
214-
select sys_trx_start from t1 into @sys_trx_start;
214+
select row_start from t1 into @row_start;
215215
insert into t0 (y) values (2);
216216
select st from t0 into @st;
217217
create or replace table t2 with system versioning as select * from t1;
@@ -224,7 +224,7 @@ t2 CREATE TABLE `t2` (
224224
select * from t2;
225225
x23
226226
1
227-
select * from t2 where sys_trx_start <= @sys_trx_start;
227+
select * from t2 where row_start <= @row_start;
228228
x23
229229
### 2. source table with visible system fields, target with invisible
230230
create or replace table t3 with system versioning as select * from t0;
@@ -237,7 +237,7 @@ t3 CREATE TABLE `t3` (
237237
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
238238
select * from t3 where y > 2;
239239
y st en
240-
select y from t3 where st = @st and sys_trx_start > @st;
240+
select y from t3 where st = @st and row_start > @st;
241241
y
242242
2
243243
### 3. source and target table with visible system fields
@@ -269,13 +269,13 @@ t3 CREATE TABLE `t3` (
269269
select * from t3;
270270
x23
271271
1
272-
create or replace table t3 with system versioning select x23, sys_trx_start from t1;
272+
create or replace table t3 with system versioning select x23, row_start from t1;
273273
ERROR HY000: Wrong parameters for `t3`: missing 'AS ROW END'
274-
create or replace table t3 with system versioning select x23, sys_trx_end from t1;
274+
create or replace table t3 with system versioning select x23, row_end from t1;
275275
ERROR HY000: Wrong parameters for `t3`: missing 'AS ROW START'
276276
# Prepare checking for historical row
277277
delete from t1;
278-
select sys_trx_end from t1 for system_time all into @sys_trx_end;
278+
select row_end from t1 for system_time all into @row_end;
279279
delete from t0;
280280
select en from t0 for system_time all into @en;
281281
## Combinations of versioned + non-versioned
@@ -291,7 +291,7 @@ t3 CREATE TABLE `t3` (
291291
select * from t3 for system_time all;
292292
x23 y
293293
1 3
294-
select * from t3 for system_time all where sys_trx_start = @sys_trx_start and sys_trx_end = @sys_trx_end;
294+
select * from t3 for system_time all where row_start = @row_start and row_end = @row_end;
295295
x23 y
296296
create or replace table t2 like t0;
297297
insert into t2 (y) values (1), (2);
@@ -308,14 +308,14 @@ y
308308
## Default engine detection
309309
create or replace table t1 (x25 int) with system versioning engine NON_DEFAULT_ENGINE;
310310
create or replace table t2
311-
as select x25, sys_trx_start, sys_trx_end from t1 for system_time all;
311+
as select x25, row_start, row_end from t1 for system_time all;
312312
show create table t2;
313313
Table Create Table
314314
t2 CREATE TABLE `t2` (
315315
`x25` int(11) DEFAULT NULL
316316
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1
317317
create or replace table t2 with system versioning
318-
as select x25, sys_trx_start, sys_trx_end from t1;
318+
as select x25, row_start, row_end from t1;
319319
show create table t2;
320320
Table Create Table
321321
t2 CREATE TABLE `t2` (
@@ -333,7 +333,7 @@ ERROR HY000: `st` must be of type TIMESTAMP(6) for system-versioned table `t2`
333333
create or replace table t1 (x27 int, id int) with system versioning engine NON_DEFAULT_ENGINE;
334334
create or replace table t2 (b int, id int);
335335
create or replace table t3 with system versioning
336-
as select t2.b, t1.x27, t1.sys_trx_start, t1.sys_trx_end from t2 inner join t1 on t2.id=t1.id;
336+
as select t2.b, t1.x27, t1.row_start, t1.row_end from t2 inner join t1 on t2.id=t1.id;
337337
show create table t3;
338338
Table Create Table
339339
t3 CREATE TABLE `t3` (
@@ -368,7 +368,7 @@ en SYS_DATATYPE as row end invisible,
368368
period for system_time (st, en)
369369
) with system versioning;
370370
create or replace table t3
371-
as select x30, y, sys_trx_start, sys_trx_end, st, en from t1, t2;
371+
as select x30, y, row_start, row_end, st, en from t1, t2;
372372
show create table t3;
373373
Table Create Table
374374
t3 CREATE TABLE `t3` (
@@ -383,7 +383,7 @@ st SYS_DATATYPE as row start invisible,
383383
en SYS_DATATYPE as row end invisible,
384384
period for system_time (st, en)
385385
) with system versioning
386-
as select x30, y, sys_trx_start, sys_trx_end, st, en from t1, t2;
386+
as select x30, y, row_start, row_end, st, en from t1, t2;
387387
show create table t3;
388388
Table Create Table
389389
t3 CREATE TABLE `t3` (

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ execute stmt;
4343
emp_id name mgr
4444
4 john 1
4545
drop prepare stmt;
46-
select emp_id from (select emp_id from emp where sys_trx_end>'2031-1-1') as tmp;
46+
select emp_id from (select emp_id from emp where row_end>'2031-1-1') as tmp;
4747
emp_id
4848
4
49-
set @tmp= "select emp_id from (select emp_id from emp where sys_trx_end>'2031-1-1') as tmp";
49+
set @tmp= "select emp_id from (select emp_id from emp where row_end>'2031-1-1') as tmp";
5050
prepare stmt from @tmp;
5151
execute stmt;
5252
emp_id
@@ -134,11 +134,11 @@ set @t0= now(6);
134134
delete from t1;
135135
insert into t1 values (2);
136136
insert into t2 values (10);
137-
select * from (select *, t1.sys_trx_end, t1.sys_trx_end as endo from t1) as s0;
138-
x sys_trx_end endo
137+
select * from (select *, t1.row_end, t1.row_end as endo from t1) as s0;
138+
x row_end endo
139139
2 # #
140-
select * from (select *, t1.sys_trx_end, t2.sys_trx_start from t1, t2) as s0;
141-
x y sys_trx_end sys_trx_start
140+
select * from (select *, t1.row_end, t2.row_start from t1, t2) as s0;
141+
x y row_end row_start
142142
2 10 # #
143143
# SYSTEM_TIME propagation from inner to outer
144144
select * from (select * from t1 for system_time as of timestamp @t0, t2) as s0;
@@ -148,11 +148,11 @@ with s1 as (select * from t1 for system_time as of timestamp @t0, t2) select * f
148148
x y
149149
1 10
150150
# leading table selection
151-
select * from (select *, t1.sys_trx_end from t2, t1 for system_time as of timestamp @t0) as s2;
152-
y x sys_trx_end
151+
select * from (select *, t1.row_end from t2, t1 for system_time as of timestamp @t0) as s2;
152+
y x row_end
153153
10 1 #
154-
with s3 as (select *, t1.sys_trx_end from t2, t1 for system_time as of timestamp @t0) select * from s3;
155-
y x sys_trx_end
154+
with s3 as (select *, t1.row_end from t2, t1 for system_time as of timestamp @t0) select * from s3;
155+
y x row_end
156156
10 1 #
157157
### VIEW instead of t1
158158
set @q= concat("create view vt1 as select * from t1 for system_time as of timestamp '", @t0, "'");
@@ -211,12 +211,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
211211
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
212212
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
213213
Query A:
214-
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`sys_trx_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t1`.`sys_trx_start` <= <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`sys_trx_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`sys_trx_start` <= <cache>(cast(current_timestamp(6) as datetime(6)))
214+
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6)))
215215
id select_type table type possible_keys key key_len ref rows filtered Extra
216216
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
217217
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
218218
Query B:
219-
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`sys_trx_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t1`.`sys_trx_start` <= <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`sys_trx_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`sys_trx_start` <= <cache>(cast(current_timestamp(6) as datetime(6)))
219+
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME ALL join `test`.`t2` FOR SYSTEM_TIME ALL where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t1`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_end` > <cache>(cast(current_timestamp(6) as datetime(6))) and `test`.`t2`.`row_start` <= <cache>(cast(current_timestamp(6) as datetime(6)))
220220
Fine result: queries A and B are equal.
221221
## LEFT JOIN: t1, t2 versioned
222222
select * from (

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ set @str= concat('
8080
engine ', engine);
8181
prepare stmt from @str; execute stmt; drop prepare stmt;
8282
insert into t1 values(1, 1, 1);
83-
select sys_trx_start, sys_trx_end from t1 into @sys_start, @sys_end;
83+
select row_start, row_end from t1 into @sys_start, @sys_end;
8484
select id, a, b from t1;
8585
insert into t1 values(2, 2, 2);
86-
select id, a, b, sys_trx_start > @sys_start as C, sys_trx_end = @sys_end as D from t1 where id = 2;
86+
select id, a, b, row_start > @sys_start as C, row_end = @sys_end as D from t1 where id = 2;
8787
drop table t1;
8888
end~~
8989
create procedure test_05(
@@ -306,18 +306,18 @@ x y current
306306
1 1 0
307307
create or replace table t1 (x int) with system versioning engine innodb;
308308
insert into t1 values (1), (2);
309-
insert into t1 (sys_trx_start) select sys_trx_end from t1;
310-
ERROR HY000: The value specified for generated column 'sys_trx_start' in table 't1' ignored
311-
insert into t1 (sys_trx_start, sys_trx_end) values (DEFAULT, 1);
312-
ERROR HY000: The value specified for generated column 'sys_trx_end' in table 't1' ignored
309+
insert into t1 (row_start) select row_end from t1;
310+
ERROR HY000: The value specified for generated column 'row_start' in table 't1' ignored
311+
insert into t1 (row_start, row_end) values (DEFAULT, 1);
312+
ERROR HY000: The value specified for generated column 'row_end' in table 't1' ignored
313313
select @@sql_mode into @saved_mode;
314314
set sql_mode= '';
315-
insert into t1 (x, sys_trx_start, sys_trx_end) values (3, 4, 5);
315+
insert into t1 (x, row_start, row_end) values (3, 4, 5);
316316
Warnings:
317-
Warning 1906 The value specified for generated column 'sys_trx_start' in table 't1' ignored
318-
Warning 1906 The value specified for generated column 'sys_trx_end' in table 't1' ignored
317+
Warning 1906 The value specified for generated column 'row_start' in table 't1' ignored
318+
Warning 1906 The value specified for generated column 'row_end' in table 't1' ignored
319319
set sql_mode= @saved_mode;
320-
insert into t1 (sys_trx_start, sys_trx_end) values (DEFAULT, DEFAULT);
320+
insert into t1 (row_start, row_end) values (DEFAULT, DEFAULT);
321321
select * from t1;
322322
x
323323
1

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ partition p0 history,
127127
partition pn current);
128128
set @now= now(6);
129129
insert into t1 values (1);
130-
set @str= concat('select x, sys_trx_start < @now as A, sys_trx_end > @now as B from t1 partition (p0)');
130+
set @str= concat('select x, row_start < @now as A, row_end > @now as B from t1 partition (p0)');
131131
prepare select_p0 from @str;
132-
set @str= concat('select x, sys_trx_start > @now as C, sys_trx_end = timestamp\'2038-01-19 03:14:07.999999\' as D from t1 partition (pn)');
132+
set @str= concat('select x, row_start > @now as C, row_end = timestamp\'2038-01-19 03:14:07.999999\' as D from t1 partition (pn)');
133133
prepare select_pn from @str;
134134
execute select_p0;
135135
x A B
@@ -140,7 +140,7 @@ x C D
140140
explain partitions select * from tN;
141141
id select_type table partitions type possible_keys key key_len ref rows Extra
142142
N SIMPLE tN pn system NULL NULL NULL NULL N
143-
set @str= concat('select sys_trx_start from t1 partition (pn) into @ts0');
143+
set @str= concat('select row_start from t1 partition (pn) into @ts0');
144144
prepare stmt from @str;
145145
execute stmt;
146146
drop prepare stmt;
@@ -151,7 +151,7 @@ x A B
151151
1 1 1
152152
execute select_pn;
153153
x C D
154-
set @str= concat('select sys_trx_start from t1 partition (p0) into @ts1');
154+
set @str= concat('select row_start from t1 partition (p0) into @ts1');
155155
prepare stmt from @str;
156156
execute stmt;
157157
drop prepare stmt;
@@ -166,7 +166,7 @@ x A B
166166
execute select_pn;
167167
x C D
168168
2 1 1
169-
set @str= concat('select sys_trx_start from t1 partition (pn) into @ts0');
169+
set @str= concat('select row_start from t1 partition (pn) into @ts0');
170170
prepare stmt from @str;
171171
execute stmt;
172172
drop prepare stmt;
@@ -181,15 +181,15 @@ x C D
181181
3 1 1
182182
drop prepare select_p0;
183183
drop prepare select_pn;
184-
set @str= concat('select sys_trx_start from t1 partition (p0) where x = 2 into @ts1');
184+
set @str= concat('select row_start from t1 partition (p0) where x = 2 into @ts1');
185185
prepare stmt from @str;
186186
execute stmt;
187187
drop prepare stmt;
188-
set @str= concat('select sys_trx_end from t1 partition (p0) where x = 2 into @ts2');
188+
set @str= concat('select row_end from t1 partition (p0) where x = 2 into @ts2');
189189
prepare stmt from @str;
190190
execute stmt;
191191
drop prepare stmt;
192-
set @str= concat('select sys_trx_start from t1 partition (pn) into @ts3');
192+
set @str= concat('select row_start from t1 partition (pn) into @ts3');
193193
prepare stmt from @str;
194194
execute stmt;
195195
drop prepare stmt;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call create_table('t', 'x int');
22
insert t values (1, 2);
33
replace t values (1, 3);
4-
select *, current_row(sys_trx_end) as current from t for system_time all
4+
select *, current_row(row_end) as current from t for system_time all
55
order by x;
66
id x current
77
1 2 0

0 commit comments

Comments
 (0)