~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/t/constraints.test

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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