summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/sql_sequence
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/sql_sequence')
-rw-r--r--mysql-test/suite/sql_sequence/alter.result58
-rw-r--r--mysql-test/suite/sql_sequence/alter.test45
2 files changed, 101 insertions, 2 deletions
diff --git a/mysql-test/suite/sql_sequence/alter.result b/mysql-test/suite/sql_sequence/alter.result
index 6d29876a..75da828c 100644
--- a/mysql-test/suite/sql_sequence/alter.result
+++ b/mysql-test/suite/sql_sequence/alter.result
@@ -210,8 +210,12 @@ create table t1 (a int);
alter sequence t1 minvalue=100;
ERROR 42S02: 'test.t1' is not a SEQUENCE
drop table t1;
+#
+# MDEV-32795: ALTER SEQUENCE IF NOT EXISTS non_existing_seq Errors rather than note
+#
alter sequence if exists t1 minvalue=100;
-ERROR 42S02: Unknown SEQUENCE: 't1'
+Warnings:
+Note 4091 Unknown SEQUENCE: 'test.t1'
alter sequence t1 minvalue=100;
ERROR 42S02: Unknown SEQUENCE: 't1'
create sequence t1;
@@ -249,6 +253,55 @@ NEXTVAL(s)
1
DROP SEQUENCE s;
#
+# MDEV-33169 Alter sequence 2nd ps fails while alter sequence 2nd time (no ps) succeeds
+#
+create sequence s;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+alter sequence s maxvalue 123;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+alter sequence s maxvalue 123;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+drop sequence s;
+create sequence s;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+prepare stmt from 'alter sequence s maxvalue 123';
+execute stmt;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+execute stmt;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+deallocate prepare stmt;
+drop sequence s;
+create sequence s;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+create procedure p() alter sequence s maxvalue 123;
+call p;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+call p;
+show create sequence s;
+Table Create Table
+s CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 123 increment by 1 cache 1000 nocycle ENGINE=MyISAM
+drop procedure p;
+drop sequence s;
+#
+# End of 10.4 tests
+#
+#
# MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
#
CREATE SEQUENCE s1 ENGINE=InnoDB;
@@ -262,3 +315,6 @@ s2 CREATE SEQUENCE `s2` start with 1 minvalue 1 maxvalue 9223372036854775806 inc
DROP SEQUENCE s2;
RENAME TABLE s1 TO s2;
DROP SEQUENCE s2;
+#
+# End of 10.6 tests
+#
diff --git a/mysql-test/suite/sql_sequence/alter.test b/mysql-test/suite/sql_sequence/alter.test
index dab0e665..7b14055d 100644
--- a/mysql-test/suite/sql_sequence/alter.test
+++ b/mysql-test/suite/sql_sequence/alter.test
@@ -120,8 +120,12 @@ create table t1 (a int);
alter sequence t1 minvalue=100;
drop table t1;
---error ER_UNKNOWN_SEQUENCES
+--echo #
+--echo # MDEV-32795: ALTER SEQUENCE IF NOT EXISTS non_existing_seq Errors rather than note
+--echo #
+
alter sequence if exists t1 minvalue=100;
+
--error ER_UNKNOWN_SEQUENCES
alter sequence t1 minvalue=100;
@@ -164,6 +168,41 @@ SELECT NEXTVAL(s);
DROP SEQUENCE s;
--echo #
+--echo # MDEV-33169 Alter sequence 2nd ps fails while alter sequence 2nd time (no ps) succeeds
+--echo #
+create sequence s;
+show create sequence s;
+alter sequence s maxvalue 123;
+show create sequence s;
+alter sequence s maxvalue 123;
+show create sequence s;
+drop sequence s;
+
+create sequence s;
+show create sequence s;
+prepare stmt from 'alter sequence s maxvalue 123';
+execute stmt;
+show create sequence s;
+execute stmt;
+show create sequence s;
+deallocate prepare stmt;
+drop sequence s;
+
+create sequence s;
+show create sequence s;
+create procedure p() alter sequence s maxvalue 123;
+call p;
+show create sequence s;
+call p;
+show create sequence s;
+drop procedure p;
+drop sequence s;
+
+--echo #
+--echo # End of 10.4 tests
+--echo #
+
+--echo #
--echo # MDEV-31607 ER_DUP_KEY in mysql.table_stats upon REANME on sequence
--echo #
@@ -176,3 +215,7 @@ RENAME TABLE s1 TO s2;
DROP SEQUENCE s2;
--enable_ps2_protocol
+
+--echo #
+--echo # End of 10.6 tests
+--echo #