1
by brian
clean slate |
1 |
drop table if exists t1;
|
2 |
create table t1 (
|
|
3 |
a int not null references t2,
|
|
4 |
b int not null references t2 (c),
|
|
5 |
primary key (a,b),
|
|
6 |
foreign key (a) references t3 match full,
|
|
7 |
foreign key (a) references t3 match partial,
|
|
8 |
foreign key (a,b) references t3 (c,d) on delete no action
|
|
9 |
on update no action,
|
|
10 |
foreign key (a,b) references t3 (c,d) on update cascade,
|
|
11 |
foreign key (a,b) references t3 (c,d) on delete set default,
|
|
12 |
foreign key (a,b) references t3 (c,d) on update set null);
|
|
13 |
create index a on t1 (a);
|
|
14 |
create unique index b on t1 (a,b);
|
|
15 |
drop table t1;
|
|
16 |
drop table if exists t_34455;
|
|
17 |
create table t_34455 (
|
|
18 |
a int not null,
|
|
19 |
foreign key (a) references t3 (a) match full match partial);
|
|
20 |
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 'match partial)' at line 3
|
|
21 |
create table t_34455 (
|
|
22 |
a int not null,
|
|
23 |
foreign key (a) references t3 (a) on delete set default match full);
|
|
24 |
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 'match full)' at line 3
|
|
25 |
create table t_34455 (
|
|
26 |
a int not null,
|
|
27 |
foreign key (a) references t3 (a) on update set default match full);
|
|
28 |
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 'match full)' at line 3
|
|
29 |
create table t_34455 (
|
|
30 |
a int not null,
|
|
31 |
foreign key (a) references t3 (a)
|
|
32 |
on delete set default on delete set default);
|
|
33 |
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 'delete set default)' at line 4
|
|
34 |
create table t_34455 (
|
|
35 |
a int not null,
|
|
36 |
foreign key (a) references t3 (a)
|
|
37 |
on update set default on update set default);
|
|
38 |
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 'update set default)' at line 4
|
|
39 |
create table t_34455 (a int not null);
|
|
40 |
alter table t_34455
|
|
41 |
add foreign key (a) references t3 (a) match full match partial);
|
|
42 |
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 'match partial)' at line 2
|
|
43 |
alter table t_34455
|
|
44 |
add foreign key (a) references t3 (a) on delete set default match full);
|
|
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 'match full)' at line 2
|
|
46 |
alter table t_34455
|
|
47 |
add foreign key (a) references t3 (a) on update set default match full);
|
|
48 |
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 'match full)' at line 2
|
|
49 |
alter table t_34455
|
|
50 |
add foreign key (a) references t3 (a)
|
|
51 |
on delete set default on delete set default);
|
|
52 |
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 'delete set default)' at line 3
|
|
53 |
alter table t_34455
|
|
54 |
add foreign key (a) references t3 (a)
|
|
55 |
on update set default on update set default);
|
|
56 |
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 'update set default)' at line 3
|
|
57 |
drop table t_34455;
|