Skip to content

Commit 0b9842a

Browse files
MDEV-13005: Fixing bugs in SEQUENCE, part 3, 2/5
Task 2: changed the error message and made it more reusable.
1 parent bb4dd70 commit 0b9842a

File tree

8 files changed

+30
-23
lines changed

8 files changed

+30
-23
lines changed

mysql-test/suite/sql_sequence/alter.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ select * from t1;
2929
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
3030
3 -100 9223372036854775806 50 1 0 0 0
3131
alter sequence t1 minvalue=100 start=100;
32-
ERROR HY000: Sequence 'test.t1' values are conflicting
32+
ERROR HY000: Sequence 'test.t1' has out of range value for options
3333
alter sequence t1 minvalue=100 start=100 restart=100;
3434
show create sequence t1;
3535
Table Create Table
@@ -200,11 +200,11 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
200200
drop sequence t1;
201201
CREATE SEQUENCE t1 engine=myisam;
202202
alter sequence t1 minvalue=100;
203-
ERROR HY000: Sequence 'test.t1' values are conflicting
203+
ERROR HY000: Sequence 'test.t1' has out of range value for options
204204
drop sequence t1;
205205
CREATE SEQUENCE t1 engine=myisam;
206206
alter sequence t1 minvalue=25 maxvalue=20;
207-
ERROR HY000: Sequence 'test.t1' values are conflicting
207+
ERROR HY000: Sequence 'test.t1' has out of range value for options
208208
drop sequence t1;
209209
create table t1 (a int);
210210
alter sequence t1 minvalue=100;

mysql-test/suite/sql_sequence/aria.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ next value for s1
5353
drop sequence s1;
5454
CREATE SEQUENCE t1;
5555
alter sequence t1 minvalue=100;
56-
ERROR HY000: Sequence 'test.t1' values are conflicting
56+
ERROR HY000: Sequence 'test.t1' has out of range value for options
5757
alter sequence t1 minvalue=100 start=100 restart=100;
5858
rename table t1 to t2;
5959
select next value for t2;

mysql-test/suite/sql_sequence/create.result

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ drop sequence if exists t1;
167167
Warnings:
168168
Note 4091 Unknown SEQUENCE: 'test.t1'
169169
create sequence t1 start with 10 maxvalue=9;
170-
ERROR HY000: Sequence 'test.t1' values are conflicting
170+
ERROR HY000: Sequence 'test.t1' has out of range value for options
171171
create sequence t1 minvalue= 100 maxvalue=10;
172-
ERROR HY000: Sequence 'test.t1' values are conflicting
172+
ERROR HY000: Sequence 'test.t1' has out of range value for options
173173
create sequence t1 start with 9 minvalue=10;
174-
ERROR HY000: Sequence 'test.t1' values are conflicting
174+
ERROR HY000: Sequence 'test.t1' has out of range value for options
175175
create or replace sequence t1 maxvalue=13, increment by -1;
176176
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' increment by -1' at line 1
177177
create or replace sequence t1 start with= 10 maxvalue=13;
@@ -183,7 +183,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
183183
create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
184184
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NO MINVALUE' at line 1
185185
create sequence t1 start with 10 maxvalue=9223372036854775807;
186-
ERROR HY000: Sequence 'test.t1' values are conflicting
186+
ERROR HY000: Sequence 'test.t1' has out of range value for options
187187
create sequence t1 start with 10 minvalue=-9223372036854775808;
188188
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '9223372036854775808' at line 1
189189
create sequence t1 RESTART WITH 10;
@@ -695,3 +695,6 @@ DROP SEQUENCE s1;
695695
# Task 1:
696696
SET @x = PREVIOUS VALUE FOR x;
697697
ERROR 42S02: Unknown SEQUENCE: 'x'
698+
# Task 2:
699+
CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
700+
ERROR HY000: Sequence 'test.x' has out of range value for options

mysql-test/suite/sql_sequence/create.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,7 @@ DROP SEQUENCE s1;
525525
--echo # Task 1:
526526
--error ER_UNKNOWN_SEQUENCES
527527
SET @x = PREVIOUS VALUE FOR x;
528+
529+
--echo # Task 2:
530+
--error ER_SEQUENCE_INVALID_DATA
531+
CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;

mysql-test/suite/sql_sequence/gtid.result

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,28 +109,28 @@ maxvalue 100000
109109
increment by 1
110110
nocache
111111
nocycle;
112-
ERROR HY000: Sequence 's_db.s2' values are conflicting
112+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
113113
create sequence s2 start with 1
114114
minvalue 5
115115
maxvalue 5
116116
increment by 1
117117
nocache
118118
nocycle;
119-
ERROR HY000: Sequence 's_db.s2' values are conflicting
119+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
120120
create sequence s2 start with 1
121121
minvalue 5
122122
maxvalue 4
123123
increment by 1
124124
nocache
125125
nocycle;
126-
ERROR HY000: Sequence 's_db.s2' values are conflicting
126+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
127127
create sequence s2 start with 1
128128
minvalue 5
129129
maxvalue 4
130130
increment by 0
131131
nocache
132132
nocycle;
133-
ERROR HY000: Sequence 's_db.s2' values are conflicting
133+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
134134
###########################################
135135
global read lock prevent query sequence
136136
###########################################
@@ -314,7 +314,7 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
314314
update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11;
315315
ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
316316
ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11;
317-
ERROR HY000: Sequence 's_db.s_t' values are conflicting
317+
ERROR HY000: Sequence 's_db.s_t' has out of range value for options
318318
commit;
319319
create table t_1(id int);
320320
insert into t_1 value(1111);

mysql-test/suite/sql_sequence/other.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ ERROR HY000: Field 'maximum_value' doesn't have a default value
5050
insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0);
5151
ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data
5252
insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0);
53-
ERROR HY000: Sequence 'test.s1' values are conflicting
53+
ERROR HY000: Sequence 'test.s1' has out of range value for options
5454
insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
55-
ERROR HY000: Sequence 'test.s1' values are conflicting
55+
ERROR HY000: Sequence 'test.s1' has out of range value for options
5656
select * from s1;
5757
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
5858
1 1 9223372036854775806 1 1 1000 0 0
@@ -67,7 +67,7 @@ select * from s1;
6767
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
6868
2000 1 9223372036854775806 1 1 1000 0 0
6969
insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
70-
ERROR HY000: Sequence 'test.s2' values are conflicting
70+
ERROR HY000: Sequence 'test.s2' has out of range value for options
7171
select * from s1;
7272
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
7373
2000 1 9223372036854775806 1 1 1000 0 0

mysql-test/suite/sql_sequence/replication.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,28 +227,28 @@ maxvalue 100000
227227
increment by 1
228228
nocache
229229
nocycle;
230-
ERROR HY000: Sequence 's_db.s2' values are conflicting
230+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
231231
create sequence s2 start with 1
232232
minvalue 5
233233
maxvalue 5
234234
increment by 1
235235
nocache
236236
nocycle;
237-
ERROR HY000: Sequence 's_db.s2' values are conflicting
237+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
238238
create sequence s2 start with 1
239239
minvalue 5
240240
maxvalue 4
241241
increment by 1
242242
nocache
243243
nocycle;
244-
ERROR HY000: Sequence 's_db.s2' values are conflicting
244+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
245245
create sequence s2 start with 1
246246
minvalue 5
247247
maxvalue 4
248248
increment by 0
249249
nocache
250250
nocycle;
251-
ERROR HY000: Sequence 's_db.s2' values are conflicting
251+
ERROR HY000: Sequence 's_db.s2' has out of range value for options
252252
###########################################
253253
global read lock prevent query sequence
254254
###########################################
@@ -412,12 +412,12 @@ select * from s_t;
412412
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
413413
16 1 20 1 1 5 1 0
414414
alter sequence s_t minvalue=11 maxvalue=9;
415-
ERROR HY000: Sequence 's_db.s_t' values are conflicting
415+
ERROR HY000: Sequence 's_db.s_t' has out of range value for options
416416
select * from s_t;
417417
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
418418
16 1 20 1 1 5 1 0
419419
alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20;
420-
ERROR HY000: Sequence 's_db.s_t' values are conflicting
420+
ERROR HY000: Sequence 's_db.s_t' has out of range value for options
421421
select * from s_t;
422422
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
423423
16 1 20 1 1 5 1 0

sql/share/errmsg-utf8.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7762,7 +7762,7 @@ ER_END_IDENTIFIER_DOES_NOT_MATCH
77627762
ER_SEQUENCE_RUN_OUT
77637763
eng "Sequence '%-.64s.%-.64s' has run out"
77647764
ER_SEQUENCE_INVALID_DATA
7765-
eng "Sequence '%-.64s.%-.64s' values are conflicting"
7765+
eng "Sequence '%-.64s.%-.64s' has out of range value for options"
77667766
ER_SEQUENCE_INVALID_TABLE_STRUCTURE
77677767
eng "Sequence '%-.64s.%-.64s' table structure is invalid (%s)"
77687768
ER_SEQUENCE_ACCESS_ERROR

0 commit comments

Comments
 (0)