📄 constraints.test
字号:
## Testing of constraints# Currently MySQL only ignores the syntax.#--disable_warningsdrop table if exists t1;--enable_warningscreate table t1 (a int check (a>0));insert into t1 values (1);insert into t1 values (0);drop table t1;create table t1 (a int ,b int, check a>b);insert into t1 values (1,0);insert into t1 values (0,1);drop table t1;create table t1 (a int ,b int, constraint abc check (a>b));insert into t1 values (1,0);insert into t1 values (0,1);drop table t1;create table t1 (a int null);insert into t1 values (1),(NULL);drop table t1;create table t1 (a int null);alter table t1 add constraint constraint_1 unique (a);alter table t1 add constraint unique key_1(a);alter table t1 add constraint constraint_2 unique key_2(a);show create table t1;drop table t1;# End of 4.1 tests
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -