summaryrefslogtreecommitdiff
path: root/mysql-test/r/check_constraint.result
diff options
context:
space:
mode:
authorJacob Mathew <jacob.mathew@mariadb.com>2017-04-17 15:32:44 -0700
committerJacob Mathew <jacob.mathew@mariadb.com>2017-04-17 15:32:44 -0700
commit38af34bb2143f2a7ce82d2e241d8995f419a7f29 (patch)
tree5ed8c6f563fc896182e6ba0745f593902e841a11 /mysql-test/r/check_constraint.result
parent3a50fd9d2f7af4b24a262c20e24e598f481b3e11 (diff)
downloadmariadb-git-38af34bb2143f2a7ce82d2e241d8995f419a7f29.tar.gz
MDEV-11117 CHECK constraint fails on intermediate step of ALTERbb-10.2-MDEV-11117
Fixed the bug by failing the statement with an error message that explains that an auto-increment column may not be used in an expression for a check constraint. Added a test case in check_constraint.test. Updated existing tests and results.
Diffstat (limited to 'mysql-test/r/check_constraint.result')
-rw-r--r--mysql-test/r/check_constraint.result2
1 files changed, 2 insertions, 0 deletions
diff --git a/mysql-test/r/check_constraint.result b/mysql-test/r/check_constraint.result
index 7447550ed09..fcda0a84fcb 100644
--- a/mysql-test/r/check_constraint.result
+++ b/mysql-test/r/check_constraint.result
@@ -140,6 +140,8 @@ create table t1 (a int, b int, check(a>0));
alter table t1 drop column a;
ERROR 42S22: Unknown column 'a' in 'CHECK'
drop table t1;
+create or replace table t1( c1 int auto_increment primary key, check( c1 > 0 or c1 is null ) );
+ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the CHECK clause of `c1`
create table t1 (a int check (@b in (select user from mysql.user)));
ERROR HY000: Function or expression 'select ...' cannot be used in the CHECK clause of `a`
create table t1 (a int check (a > @b));