From 38af34bb2143f2a7ce82d2e241d8995f419a7f29 Mon Sep 17 00:00:00 2001 From: Jacob Mathew Date: Mon, 17 Apr 2017 15:32:44 -0700 Subject: MDEV-11117 CHECK constraint fails on intermediate step of ALTER 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. --- mysql-test/t/check_constraint.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/t/check_constraint.test') diff --git a/mysql-test/t/check_constraint.test b/mysql-test/t/check_constraint.test index 437463ee457..c70a208f774 100644 --- a/mysql-test/t/check_constraint.test +++ b/mysql-test/t/check_constraint.test @@ -87,6 +87,12 @@ create table t1 (a int, b int, check(a>0)); alter table t1 drop column a; drop table t1; +# +# MDEV-11117 CHECK constraint fails on intermediate step of ALTER +# +-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED +create or replace table t1( c1 int auto_increment primary key, check( c1 > 0 or c1 is null ) ); + # # MDEV-12421 Check constraint with query crashes server and renders DB unusable # -- cgit v1.2.1