From 42529c4341ab8d4d5b2b7982baa9431ccdce6860 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Mar 2018 20:35:38 +0100 Subject: [PATCH] MDEV-15141 Check constraint validation on a datetime field crashes the process add the test case (the bug was fixed in d390e501eb8) --- mysql-test/r/check_constraint.result | 4 ++++ mysql-test/t/check_constraint.test | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/mysql-test/r/check_constraint.result b/mysql-test/r/check_constraint.result index 525140d96e7..70d64cd6ff7 100644 --- a/mysql-test/r/check_constraint.result +++ b/mysql-test/r/check_constraint.result @@ -152,3 +152,7 @@ a 1 NULL drop table t1; +create table t1 (id int auto_increment primary key, datecol datetime, check (datecol>'0001-01-01 00:00:00')); +insert into t1 (datecol) values (now()); +insert into t1 (datecol) values (now()); +drop table t1; diff --git a/mysql-test/t/check_constraint.test b/mysql-test/t/check_constraint.test index f72ce38087e..9a77736acd7 100644 --- a/mysql-test/t/check_constraint.test +++ b/mysql-test/t/check_constraint.test @@ -103,3 +103,11 @@ insert t1 values (2); insert t1 values (NULL); select * from t1; drop table t1; + +# +# MDEV-15141 Check constraint validation on a datetime field crashes the process +# +create table t1 (id int auto_increment primary key, datecol datetime, check (datecol>'0001-01-01 00:00:00')); +insert into t1 (datecol) values (now()); +insert into t1 (datecol) values (now()); +drop table t1;