summaryrefslogtreecommitdiff
path: root/mysql-test/main/constraints.test
diff options
context:
space:
mode:
authorAnel Husakovic <anelhusakovic88@gmail.com>2018-04-20 07:06:25 +0000
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-05-18 11:47:14 +0300
commitadf9f8d99528d5cc965cc63c498c27eb0dfd1ed1 (patch)
treed92c87bcab11939dd0d728993ffb5d3837319935 /mysql-test/main/constraints.test
parent395c8ca708c15e7f4b8dca5c3f5246d03eb557af (diff)
downloadmariadb-git-bb-anel-check_constraing.tar.gz
Add error message in case of the `field` `check` constraintsbb-anel-check_constraing
One can create table with the same name for `field` and `table` `check` constraint. For example: create table t(a int check(a>0), constraint a check(a>10)); But when inserting new rows same error is always raised. For example with insert into t values (-1); insert into t values (10); same error `ER_CONSTRAINT_FAILED` is returned for both queries. By the assumption that the previous error should be raised only in case of `table` constraints, this patch will distinguish between `field` and `table` error message by adding newly created `ER_FIELD_CONSTRAINT_FAILED` error which occurs only when `field` constraint is violated.
Diffstat (limited to 'mysql-test/main/constraints.test')
-rw-r--r--mysql-test/main/constraints.test2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysql-test/main/constraints.test b/mysql-test/main/constraints.test
index 1997c23bfa9..33cff30f8a8 100644
--- a/mysql-test/main/constraints.test
+++ b/mysql-test/main/constraints.test
@@ -8,7 +8,7 @@ drop table if exists t1;
create table t1 (a int check (a>0));
show create table t1;
insert into t1 values (1);
---error ER_CONSTRAINT_FAILED
+--error ER_FIELD_CONSTRAINT_FAILED
insert into t1 values (0);
drop table t1;
create table t1 (a int, b int, check (a>b));