Skip to content

Commit 303d72a

Browse files
committed
SQL: redundant error codes reduced
Replaced codes: ER_NO_VERSIONED_FIELDS_IN_VERSIONED_TABLE ER_MISSING_WITH_SYSTEM_VERSIONING ER_SYS_START_NOT_SPECIFIED ER_SYS_END_NOT_SPECIFIED ER_MISSING_PERIOD_FOR_SYSTEM_TIME ER_PERIOD_FOR_SYSTEM_TIME_CONTAINS_WRONG_START_COLUMN ER_PERIOD_FOR_SYSTEM_TIME_CONTAINS_WRONG_END_COLUMN ER_SYS_START_AND_SYS_END_SAME ER_SYS_START_MORE_THAN_ONCE ER_SYS_END_MORE_THAN_ONCE with: ER_VERS_WRONG_PARAMS ER_VERS_FIELD_WRONG_TYPE
1 parent 52a6812 commit 303d72a

File tree

10 files changed

+104
-151
lines changed

10 files changed

+104
-151
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,91 +32,91 @@ Sys_start2 timestamp(6) generated always as row start,
3232
Sys_end timestamp(6) generated always as row end,
3333
period for system_time (Sys_start, Sys_end)
3434
) with system versioning;
35-
ERROR HY000: 'Generated as row start' specified more than once
35+
ERROR HY000: Wrong parameters for versioned table `t1`: multiple 'GENERATED ALWAYS AS ROW START'
3636
create or replace table t1 (
3737
XNo int unsigned,
3838
Sys_start timestamp(6) generated always as row start,
3939
Sys_end2 timestamp(6) generated always as row end,
4040
period for system_time (Sys_start, Sys_end)
4141
) with system versioning;
42-
ERROR HY000: Second column in 'period for system time' must be equal to 'generated as row end' column
42+
ERROR HY000: Wrong parameters for versioned table `t1`: 'PERIOD FOR SYSTEM_TIME' and 'GENERATED AS ROW END' mismatch
4343
create or replace table t1 (
4444
XNo int unsigned,
4545
Sys_start timestamp(6) generated always as row start,
4646
Sys_end timestamp(6) generated always as row end,
4747
Sys_end2 timestamp(6) generated always as row end,
4848
period for system_time (Sys_start, Sys_end)
4949
) with system versioning;
50-
ERROR HY000: Generated as row end specified more than once
50+
ERROR HY000: Wrong parameters for versioned table `t1`: multiple 'GENERATED ALWAYS AS ROW END'
5151
create or replace table t1 (
5252
XNo int unsigned,
5353
period for system_time (Sys_start, Sys_end)
5454
) with system versioning;
55-
ERROR HY000: 'Generated as row start' not specified
55+
ERROR HY000: Wrong parameters for versioned table `t1`: 'GENERATED AS ROW START' column missing
5656
create or replace table t1 (
5757
XNo int unsigned,
5858
Sys_start timestamp(6) generated always as row start,
5959
Sys_end timestamp(6) generated always as row end,
6060
Sys_end2 timestamp(6) generated always as row end,
6161
period for system_time (Sys_start, Sys_end)
6262
);
63-
ERROR HY000: Generated as row end specified more than once
63+
ERROR HY000: Wrong parameters for versioned table `t1`: multiple 'GENERATED ALWAYS AS ROW END'
6464
create or replace table t1 (
6565
XNo int unsigned,
6666
Sys_start timestamp(6) generated always as row start,
6767
Sys_end timestamp(6) generated always as row end,
6868
period for system_time (sys_insert, sys_remove)
6969
) with system versioning;
70-
ERROR HY000: First column in 'period for system time' must be equal to 'generated as row start' column
70+
ERROR HY000: Wrong parameters for versioned table `t1`: 'PERIOD FOR SYSTEM_TIME' and 'GENERATED AS ROW START' mismatch
7171
create or replace table t1 (
7272
XNo int unsigned,
7373
Sys_start timestamp(6) generated always as row start,
7474
Sys_end timestamp(6) generated always as row end,
7575
period for system_time (Sys_start, Sys_end)
7676
);
77-
ERROR HY000: 'With system versioning' is missing
77+
ERROR HY000: Wrong parameters for versioned table `t1`: 'WITH SYSTEM VERSIONING' missing
7878
create or replace table t1 (
7979
XNo int unsigned,
8080
Sys_start timestamp(6) generated always as row start,
8181
Sys_end timestamp(6) generated always as row end,
8282
period for system_time (Sys_start, Sys_start)
8383
);
84-
ERROR HY000: 'Period for system_time' must contain two different columns
84+
ERROR HY000: Wrong parameters for versioned table `t1`: 'PERIOD FOR SYSTEM_TIME' columns must be different
8585
create or replace table t1 (
8686
XNo int unsigned,
8787
Sys_start int generated always as row start,
8888
Sys_end timestamp(6) generated always as row end,
8989
period for system_time (Sys_start, Sys_end)
9090
) with system versioning;
91-
ERROR HY000: System start field must be of type TIMESTAMP
91+
ERROR HY000: `Sys_start` must be of type `TIMESTAMP` for versioned table `t1`
9292
create or replace table t1 (
9393
XNo int unsigned,
9494
Sys_start timestamp(6) generated always as row start,
9595
Sys_end int generated always as row end,
9696
period for system_time (Sys_start, Sys_end)
9797
) with system versioning;
98-
ERROR HY000: System end field must be of type TIMESTAMP
98+
ERROR HY000: `Sys_end` must be of type `TIMESTAMP` for versioned table `t1`
9999
create or replace table t1 (
100100
XNo int unsigned,
101101
Sys_start timestamp(6) generated always as row start,
102102
Sys_end bigint generated always as row end,
103103
period for system_time (Sys_start, Sys_end)
104104
) with system versioning engine innodb;
105-
ERROR HY000: System start field must be of type BIGINT UNSIGNED
105+
ERROR HY000: `Sys_start` must be of type `BIGINT UNSIGNED` for versioned table `t1`
106106
create or replace table t1 (
107107
XNo int unsigned,
108108
Sys_start bigint generated always as row start,
109109
Sys_end bigint generated always as row end,
110110
period for system_time (Sys_start, Sys_end)
111111
) with system versioning engine innodb;
112-
ERROR HY000: System start field must be of type BIGINT UNSIGNED
112+
ERROR HY000: `Sys_start` must be of type `BIGINT UNSIGNED` for versioned table `t1`
113113
create or replace table t1 (
114114
XNo int unsigned,
115115
Sys_start bigint unsigned generated always as row start,
116116
Sys_end bigint generated always as row end,
117117
period for system_time (Sys_start, Sys_end)
118118
) with system versioning engine innodb;
119-
ERROR HY000: System end field must be of type BIGINT UNSIGNED
119+
ERROR HY000: `Sys_end` must be of type `BIGINT UNSIGNED` for versioned table `t1`
120120
create or replace table t1 (
121121
A int with system versioning,
122122
B int
@@ -147,7 +147,7 @@ create or replace table t1 (
147147
A int,
148148
B int without system versioning
149149
);
150-
ERROR HY000: Every field specified unversioned in versioned table
150+
ERROR HY000: Wrong parameters for versioned table `t1`: 'WITH SYSTEM VERSIONING' missing
151151
create or replace table t1 (
152152
A int,
153153
B int without system versioning
@@ -190,9 +190,9 @@ t1 CREATE TABLE `t1` (
190190
create or replace table t1 (
191191
A int without system versioning
192192
);
193-
ERROR HY000: Every field specified unversioned in versioned table
193+
ERROR HY000: Wrong parameters for versioned table `t1`: 'WITH SYSTEM VERSIONING' missing
194194
create or replace table t1 (
195195
A int without system versioning
196196
) with system versioning;
197-
ERROR HY000: Every field specified unversioned in versioned table
197+
ERROR HY000: Wrong parameters for versioned table `t1`: versioned fields missing
198198
drop table t1;

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,50 @@ a b b+0
1717
1 NULL NULL
1818
3 NULL NULL
1919
Warnings:
20-
Warning4067Attempt to read unversioned field 'b' in historical query
20+
Warning4055Attempt to read unversioned field 'b' in historical query
2121
select * from t for system_time as of timestamp now(6);
2222
a b
2323
1 NULL
2424
3 NULL
2525
Warnings:
26-
Warning4067Attempt to read unversioned field 'b' in historical query
26+
Warning4055Attempt to read unversioned field 'b' in historical query
2727
select count(*) from t group by b for system_time as of timestamp now(6);
2828
count(*)
2929
2
3030
Warnings:
31-
Warning4067Attempt to read unversioned field 'b' in historical query
31+
Warning4055Attempt to read unversioned field 'b' in historical query
3232
select * from t for system_time as of timestamp now(6) order by b asc;
3333
a b
3434
1 NULL
3535
3 NULL
3636
Warnings:
37-
Warning4067Attempt to read unversioned field 'b' in historical query
37+
Warning4055Attempt to read unversioned field 'b' in historical query
3838
select * from t for system_time as of timestamp now(6) order by b desc;
3939
a b
4040
1 NULL
4141
3 NULL
4242
Warnings:
43-
Warning4067Attempt to read unversioned field 'b' in historical query
43+
Warning4055Attempt to read unversioned field 'b' in historical query
4444
select * from t group by a having a=2 for system_time as of timestamp now(6);
4545
a b
4646
Warnings:
47-
Warning4067Attempt to read unversioned field 'b' in historical query
47+
Warning4055Attempt to read unversioned field 'b' in historical query
4848
select * from t group by b having b=2 for system_time as of timestamp now(6);
4949
a b
5050
Warnings:
51-
Warning4067Attempt to read unversioned field 'b' in historical query
51+
Warning4055Attempt to read unversioned field 'b' in historical query
5252
select a from t where b=2 for system_time as of timestamp now(6);
5353
a
5454
Warnings:
55-
Warning4067Attempt to read unversioned field 'b' in historical query
55+
Warning4055Attempt to read unversioned field 'b' in historical query
5656
select a from t where b=NULL for system_time as of timestamp now(6);
5757
a
5858
Warnings:
59-
Warning4067Attempt to read unversioned field 'b' in historical query
59+
Warning4055Attempt to read unversioned field 'b' in historical query
6060
select count(*), b from t group by b having b=NULL for system_time as of timestamp now(6);
6161
count(*) b
6262
Warnings:
63-
Warning4067Attempt to read unversioned field 'b' in historical query
63+
Warning4055Attempt to read unversioned field 'b' in historical query
6464
select a, b from t;
6565
a b
6666
1 2

mysql-test/suite/versioning/t/create.test

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ create or replace table t1 (
1818
) with system versioning;
1919
show create table t1;
2020

21-
--error ER_SYS_START_MORE_THAN_ONCE
21+
--error ER_VERS_WRONG_PARAMS
2222
create or replace table t1 (
2323
XNo int unsigned,
2424
Sys_start timestamp(6) generated always as row start,
@@ -27,15 +27,15 @@ create or replace table t1 (
2727
period for system_time (Sys_start, Sys_end)
2828
) with system versioning;
2929

30-
--error ER_PERIOD_FOR_SYSTEM_TIME_CONTAINS_WRONG_END_COLUMN
30+
--error ER_VERS_WRONG_PARAMS
3131
create or replace table t1 (
3232
XNo int unsigned,
3333
Sys_start timestamp(6) generated always as row start,
3434
Sys_end2 timestamp(6) generated always as row end,
3535
period for system_time (Sys_start, Sys_end)
3636
) with system versioning;
3737

38-
--error ER_SYS_END_MORE_THAN_ONCE
38+
--error ER_VERS_WRONG_PARAMS
3939
create or replace table t1 (
4040
XNo int unsigned,
4141
Sys_start timestamp(6) generated always as row start,
@@ -44,13 +44,13 @@ create or replace table t1 (
4444
period for system_time (Sys_start, Sys_end)
4545
) with system versioning;
4646

47-
--error ER_SYS_START_NOT_SPECIFIED
47+
--error ER_VERS_WRONG_PARAMS
4848
create or replace table t1 (
4949
XNo int unsigned,
5050
period for system_time (Sys_start, Sys_end)
5151
) with system versioning;
5252

53-
--error ER_SYS_END_MORE_THAN_ONCE
53+
--error ER_VERS_WRONG_PARAMS
5454
create or replace table t1 (
5555
XNo int unsigned,
5656
Sys_start timestamp(6) generated always as row start,
@@ -59,63 +59,63 @@ create or replace table t1 (
5959
period for system_time (Sys_start, Sys_end)
6060
);
6161

62-
--error ER_PERIOD_FOR_SYSTEM_TIME_CONTAINS_WRONG_START_COLUMN
62+
--error ER_VERS_WRONG_PARAMS
6363
create or replace table t1 (
6464
XNo int unsigned,
6565
Sys_start timestamp(6) generated always as row start,
6666
Sys_end timestamp(6) generated always as row end,
6767
period for system_time (sys_insert, sys_remove)
6868
) with system versioning;
6969

70-
--error ER_MISSING_WITH_SYSTEM_VERSIONING
70+
--error ER_VERS_WRONG_PARAMS
7171
create or replace table t1 (
7272
XNo int unsigned,
7373
Sys_start timestamp(6) generated always as row start,
7474
Sys_end timestamp(6) generated always as row end,
7575
period for system_time (Sys_start, Sys_end)
7676
);
7777

78-
--error ER_SYS_START_AND_SYS_END_SAME
78+
--error ER_VERS_WRONG_PARAMS
7979
create or replace table t1 (
8080
XNo int unsigned,
8181
Sys_start timestamp(6) generated always as row start,
8282
Sys_end timestamp(6) generated always as row end,
8383
period for system_time (Sys_start, Sys_start)
8484
);
8585

86-
--error ER_SYS_START_FIELD_MUST_BE_TIMESTAMP
86+
--error ER_VERS_FIELD_WRONG_TYPE
8787
create or replace table t1 (
8888
XNo int unsigned,
8989
Sys_start int generated always as row start,
9090
Sys_end timestamp(6) generated always as row end,
9191
period for system_time (Sys_start, Sys_end)
9292
) with system versioning;
9393

94-
--error ER_SYS_END_FIELD_MUST_BE_TIMESTAMP
94+
--error ER_VERS_FIELD_WRONG_TYPE
9595
create or replace table t1 (
9696
XNo int unsigned,
9797
Sys_start timestamp(6) generated always as row start,
9898
Sys_end int generated always as row end,
9999
period for system_time (Sys_start, Sys_end)
100100
) with system versioning;
101101

102-
--error ER_SYS_START_FIELD_MUST_BE_BIGINT
102+
--error ER_VERS_FIELD_WRONG_TYPE
103103
create or replace table t1 (
104104
XNo int unsigned,
105105
Sys_start timestamp(6) generated always as row start,
106106
Sys_end bigint generated always as row end,
107107
period for system_time (Sys_start, Sys_end)
108108
) with system versioning engine innodb;
109109

110-
--error ER_SYS_START_FIELD_MUST_BE_BIGINT
110+
--error ER_VERS_FIELD_WRONG_TYPE
111111
create or replace table t1 (
112112
XNo int unsigned,
113113
Sys_start bigint generated always as row start,
114114
Sys_end bigint generated always as row end,
115115
period for system_time (Sys_start, Sys_end)
116116
) with system versioning engine innodb;
117117

118-
--error ER_SYS_END_FIELD_MUST_BE_BIGINT
118+
--error ER_VERS_FIELD_WRONG_TYPE
119119
create or replace table t1 (
120120
XNo int unsigned,
121121
Sys_start bigint unsigned generated always as row start,
@@ -135,7 +135,7 @@ create or replace table t1 (
135135
) with system versioning;
136136
show create table t1;
137137

138-
--error ER_NO_VERSIONED_FIELDS_IN_VERSIONED_TABLE
138+
--error ER_VERS_WRONG_PARAMS
139139
create or replace table t1 (
140140
A int,
141141
B int without system versioning
@@ -159,12 +159,12 @@ create or replace table t1 (
159159
) with system versioning;
160160
show create table t1;
161161

162-
--error ER_NO_VERSIONED_FIELDS_IN_VERSIONED_TABLE
162+
--error ER_VERS_WRONG_PARAMS
163163
create or replace table t1 (
164164
A int without system versioning
165165
);
166166

167-
--error ER_NO_VERSIONED_FIELDS_IN_VERSIONED_TABLE
167+
--error ER_VERS_WRONG_PARAMS
168168
create or replace table t1 (
169169
A int without system versioning
170170
) with system versioning;

0 commit comments

Comments
 (0)