summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2022-03-28 15:08:25 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2022-03-30 15:12:43 +0530
commit0b9842a3e766ec56ff3e14bec387dc639677c4db (patch)
tree2cafecea2517d70c04e1965a1a49cbf2c5a3b519
parentbb4dd70e7c6509ed9bf8c38d44dffb6d2fcca415 (diff)
downloadmariadb-git-0b9842a3e766ec56ff3e14bec387dc639677c4db.tar.gz
MDEV-13005: Fixing bugs in SEQUENCE, part 3, 2/5
Task 2: changed the error message and made it more reusable.
-rw-r--r--mysql-test/suite/sql_sequence/alter.result6
-rw-r--r--mysql-test/suite/sql_sequence/aria.result2
-rw-r--r--mysql-test/suite/sql_sequence/create.result11
-rw-r--r--mysql-test/suite/sql_sequence/create.test4
-rw-r--r--mysql-test/suite/sql_sequence/gtid.result10
-rw-r--r--mysql-test/suite/sql_sequence/other.result6
-rw-r--r--mysql-test/suite/sql_sequence/replication.result12
-rw-r--r--sql/share/errmsg-utf8.txt2
8 files changed, 30 insertions, 23 deletions
diff --git a/mysql-test/suite/sql_sequence/alter.result b/mysql-test/suite/sql_sequence/alter.result
index e0acc1c1b23..90de2ebfcc0 100644
--- a/mysql-test/suite/sql_sequence/alter.result
+++ b/mysql-test/suite/sql_sequence/alter.result
@@ -29,7 +29,7 @@ select * from t1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
3 -100 9223372036854775806 50 1 0 0 0
alter sequence t1 minvalue=100 start=100;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100;
show create sequence t1;
Table Create Table
@@ -200,11 +200,11 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=100;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1;
CREATE SEQUENCE t1 engine=myisam;
alter sequence t1 minvalue=25 maxvalue=20;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
drop sequence t1;
create table t1 (a int);
alter sequence t1 minvalue=100;
diff --git a/mysql-test/suite/sql_sequence/aria.result b/mysql-test/suite/sql_sequence/aria.result
index b39d85d58ca..cfc7d946772 100644
--- a/mysql-test/suite/sql_sequence/aria.result
+++ b/mysql-test/suite/sql_sequence/aria.result
@@ -53,7 +53,7 @@ next value for s1
drop sequence s1;
CREATE SEQUENCE t1;
alter sequence t1 minvalue=100;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
alter sequence t1 minvalue=100 start=100 restart=100;
rename table t1 to t2;
select next value for t2;
diff --git a/mysql-test/suite/sql_sequence/create.result b/mysql-test/suite/sql_sequence/create.result
index 65a4697a6ca..a7138756b11 100644
--- a/mysql-test/suite/sql_sequence/create.result
+++ b/mysql-test/suite/sql_sequence/create.result
@@ -167,11 +167,11 @@ drop sequence if exists t1;
Warnings:
Note 4091 Unknown SEQUENCE: 'test.t1'
create sequence t1 start with 10 maxvalue=9;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 minvalue= 100 maxvalue=10;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 start with 9 minvalue=10;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
create or replace sequence t1 maxvalue=13, increment by -1;
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
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
create or replace sequence t1 start with 10 min_value=1 NO MINVALUE;
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
create sequence t1 start with 10 maxvalue=9223372036854775807;
-ERROR HY000: Sequence 'test.t1' values are conflicting
+ERROR HY000: Sequence 'test.t1' has out of range value for options
create sequence t1 start with 10 minvalue=-9223372036854775808;
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
create sequence t1 RESTART WITH 10;
@@ -695,3 +695,6 @@ DROP SEQUENCE s1;
# Task 1:
SET @x = PREVIOUS VALUE FOR x;
ERROR 42S02: Unknown SEQUENCE: 'x'
+# Task 2:
+CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
+ERROR HY000: Sequence 'test.x' has out of range value for options
diff --git a/mysql-test/suite/sql_sequence/create.test b/mysql-test/suite/sql_sequence/create.test
index 9d69924ca71..39fb5a9c9cd 100644
--- a/mysql-test/suite/sql_sequence/create.test
+++ b/mysql-test/suite/sql_sequence/create.test
@@ -525,3 +525,7 @@ DROP SEQUENCE s1;
--echo # Task 1:
--error ER_UNKNOWN_SEQUENCES
SET @x = PREVIOUS VALUE FOR x;
+
+--echo # Task 2:
+--error ER_SEQUENCE_INVALID_DATA
+CREATE SEQUENCE x START WITH 1 INCREMENT BY 123456789012345678;
diff --git a/mysql-test/suite/sql_sequence/gtid.result b/mysql-test/suite/sql_sequence/gtid.result
index 8ca9a397354..495e4b806b7 100644
--- a/mysql-test/suite/sql_sequence/gtid.result
+++ b/mysql-test/suite/sql_sequence/gtid.result
@@ -109,28 +109,28 @@ maxvalue 100000
increment by 1
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 5
increment by 1
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 1
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 0
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
###########################################
global read lock prevent query sequence
###########################################
@@ -314,7 +314,7 @@ next_not_cached_value minimum_value maximum_value start_value increment cache_si
update s_t set next_not_cached_value= 11,start_value=10, minimum_value=11;
ERROR HY000: Storage engine SEQUENCE of the table `s_db`.`s_t` doesn't have this option
ALTER SEQUENCE s_t restart with 11 start=10 minvalue=11;
-ERROR HY000: Sequence 's_db.s_t' values are conflicting
+ERROR HY000: Sequence 's_db.s_t' has out of range value for options
commit;
create table t_1(id int);
insert into t_1 value(1111);
diff --git a/mysql-test/suite/sql_sequence/other.result b/mysql-test/suite/sql_sequence/other.result
index 643233149d2..8ac766702d3 100644
--- a/mysql-test/suite/sql_sequence/other.result
+++ b/mysql-test/suite/sql_sequence/other.result
@@ -50,9 +50,9 @@ ERROR HY000: Field 'maximum_value' doesn't have a default value
insert into s1 values (next value for s1, 1,9223372036854775806,1,1,1000,0,0);
ERROR HY000: Table 's1' is specified twice, both as a target for 'INSERT' and as a separate source for data
insert into s1 values(1000,9223372036854775806,1,1,1,1000,0,0);
-ERROR HY000: Sequence 'test.s1' values are conflicting
+ERROR HY000: Sequence 'test.s1' has out of range value for options
insert into s1 values(0,9223372036854775806,1,1,1,1000,0,0);
-ERROR HY000: Sequence 'test.s1' values are conflicting
+ERROR HY000: Sequence 'test.s1' has out of range value for options
select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
1 1 9223372036854775806 1 1 1000 0 0
@@ -67,7 +67,7 @@ select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
2000 1 9223372036854775806 1 1 1000 0 0
insert into s2 values(0, 1, 10, 1, 2, 1, 1, 0);
-ERROR HY000: Sequence 'test.s2' values are conflicting
+ERROR HY000: Sequence 'test.s2' has out of range value for options
select * from s1;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
2000 1 9223372036854775806 1 1 1000 0 0
diff --git a/mysql-test/suite/sql_sequence/replication.result b/mysql-test/suite/sql_sequence/replication.result
index 7bf0eac8c47..c429b74b4cd 100644
--- a/mysql-test/suite/sql_sequence/replication.result
+++ b/mysql-test/suite/sql_sequence/replication.result
@@ -227,28 +227,28 @@ maxvalue 100000
increment by 1
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 5
increment by 1
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 1
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
create sequence s2 start with 1
minvalue 5
maxvalue 4
increment by 0
nocache
nocycle;
-ERROR HY000: Sequence 's_db.s2' values are conflicting
+ERROR HY000: Sequence 's_db.s2' has out of range value for options
###########################################
global read lock prevent query sequence
###########################################
@@ -412,12 +412,12 @@ select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0
alter sequence s_t minvalue=11 maxvalue=9;
-ERROR HY000: Sequence 's_db.s_t' values are conflicting
+ERROR HY000: Sequence 's_db.s_t' has out of range value for options
select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0
alter sequence s_t restart= 12 start=10 minvalue=11 maxvalue=20;
-ERROR HY000: Sequence 's_db.s_t' values are conflicting
+ERROR HY000: Sequence 's_db.s_t' has out of range value for options
select * from s_t;
next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
16 1 20 1 1 5 1 0
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 4b744140afb..d913563dae3 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -7762,7 +7762,7 @@ ER_END_IDENTIFIER_DOES_NOT_MATCH
ER_SEQUENCE_RUN_OUT
eng "Sequence '%-.64s.%-.64s' has run out"
ER_SEQUENCE_INVALID_DATA
- eng "Sequence '%-.64s.%-.64s' values are conflicting"
+ eng "Sequence '%-.64s.%-.64s' has out of range value for options"
ER_SEQUENCE_INVALID_TABLE_STRUCTURE
eng "Sequence '%-.64s.%-.64s' table structure is invalid (%s)"
ER_SEQUENCE_ACCESS_ERROR