~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
#
2
# Testing of constraints
3
# Currently MySQL only ignores the syntax.
4
#
5
--disable_warnings
6
drop table if exists t1;
7
--enable_warnings
8
9
create table t1 (a int check (a>0));
10
insert into t1 values (1);
11
insert into t1 values (0);
12
drop table t1;
13
create table t1 (a int ,b int, check a>b);
14
insert into t1 values (1,0);
15
insert into t1 values (0,1);
16
drop table t1;
17
create table t1 (a int ,b int, constraint abc check (a>b));
18
insert into t1 values (1,0);
19
insert into t1 values (0,1);
20
drop table t1;
21
create table t1 (a int null);
22
insert into t1 values (1),(NULL);
23
drop table t1;
24
create table t1 (a int null);
25
alter table t1 add constraint constraint_1 unique (a);
26
alter table t1 add constraint unique key_1(a);
27
alter table t1 add constraint constraint_2 unique key_2(a);
28
show create table t1;
29
drop table t1;
30
31
# End of 4.1 tests