summaryrefslogtreecommitdiff
path: root/mysql-test/t/check.test
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-12-14 14:28:30 +0100
committerSergei Golubchik <serg@mariadb.org>2018-12-20 08:06:55 +0100
commit7b2e2288e9f784ea12f85dc005503511fe99f796 (patch)
treea64ade4e4d6f7a98e78210b757053e8114a94f4c /mysql-test/t/check.test
parenta79183b01e4e1f3af55abd102715560cecbbddae (diff)
downloadmariadb-git-7b2e2288e9f784ea12f85dc005503511fe99f796.tar.gz
MDEV-16903 Assertion `!auto_increment_field_not_null' failed in TABLE::init after unsuccessful attempt to add CHECK constraint on temporary table
if the CHECK constraint failed in copy_data_between_tables(), the loop was aborted prematurely and to->auto_increment_field_not_null wasn't reset.
Diffstat (limited to 'mysql-test/t/check.test')
-rw-r--r--mysql-test/t/check.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test
index cce8fd34c9c..475a7996a09 100644
--- a/mysql-test/t/check.test
+++ b/mysql-test/t/check.test
@@ -103,3 +103,15 @@ CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
ALTER TABLE t1 DROP COLUMN b, DROP CONSTRAINT `CONSTRAINT_1`;
SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+#
+# MDEV-16903 Assertion `!auto_increment_field_not_null' failed in TABLE::init after unsuccessful attempt to add CHECK constraint on temporary table
+#
+create temporary table t1 (
+ id int not null auto_increment primary key,
+ f int not null default 0
+);
+insert into t1 () values ();
+alter ignore table t1 add constraint check (f > 0);
+alter table t1;
+drop table t1;