You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mysql-test/r/constraints.result
+17-1
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ create table t1 (a int check (a>0));
3
3
insert into t1 values (1);
4
4
insert into t1 values (0);
5
5
drop table t1;
6
-
create table t1 (a int ,b int, check a>b);
6
+
create table t1 (a int, b int, check (a>b));
7
7
insert into t1 values (1,0);
8
8
insert into t1 values (0,1);
9
9
drop table t1;
@@ -27,3 +27,19 @@ t1 CREATE TABLE `t1` (
27
27
UNIQUE KEY `key_2` (`a`)
28
28
) ENGINE=MyISAM DEFAULT CHARSET=latin1
29
29
drop table t1;
30
+
drop table if exists t_illegal;
31
+
create table t_illegal (a int, b int, check a>b);
32
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a>b)' at line 1
33
+
create table t_illegal (a int, b int, constraint abc check a>b);
34
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a>b)' at line 1
35
+
create table t_illegal (a int, b int, constraint abc);
36
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
37
+
drop table if exists t_11714;
38
+
create table t_11714(a int, b int);
39
+
alter table t_11714 add constraint cons1;
40
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
41
+
drop table t_11714;
42
+
CREATE TABLE t_illegal (col_1 INT CHECK something (whatever));
43
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something (whatever))' at line 1
44
+
CREATE TABLE t_illegal (col_1 INT CHECK something);
45
+
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'something)' at line 1
0 commit comments