summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sql_sequence/other.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/sql_sequence/other.test')
-rw-r--r--mysql-test/suite/sql_sequence/other.test17
1 files changed, 16 insertions, 1 deletions
diff --git a/mysql-test/suite/sql_sequence/other.test b/mysql-test/suite/sql_sequence/other.test
index d816ec7c108..1903fc296f9 100644
--- a/mysql-test/suite/sql_sequence/other.test
+++ b/mysql-test/suite/sql_sequence/other.test
@@ -74,7 +74,7 @@ create sequence s1;
create table t1 (a int);
create view v1 as select * from s1;
show full tables;
-SELECT TABLE_TYPE,ENGINE FROM INFORMATION_SCHEMA.TABLES where table_schema="test";
+SELECT TABLE_TYPE,ENGINE FROM INFORMATION_SCHEMA.TABLES where table_schema="test" ORDER BY TABLE_NAME;
drop table t1,s1;
drop view v1;
@@ -131,3 +131,18 @@ create sequence s2;
select next value for s1;
unlock tables;
drop sequence s1;
+
+--echo #
+--echo # Don't allow SQUENCE to be used with CHECK or virtual fields
+--echo #
+
+CREATE SEQUENCE s1 nocache engine=myisam;
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE table t1 (a int check (next value for s1 > 0));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE table t1 (a int check (previous value for s1 > 0));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE table t1 (a int check (setval(s1,10)));
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+CREATE TABLE t1 (a int, b int as (next value for s1 > 0));
+drop sequence s1;