722
by Brian Aker
Updated/fix to foreign key test. |
1 |
CREATE TABLE product (category INT NOT NULL, id INT NOT NULL, |
2 |
price DECIMAL, |
|
3 |
PRIMARY KEY(category, id)) ENGINE=INNODB; |
|
4 |
CREATE TABLE customer (id INT NOT NULL, |
|
5 |
PRIMARY KEY (id)) ENGINE=INNODB; |
|
6 |
CREATE TABLE product_order (no INT NOT NULL AUTO_INCREMENT, |
|
7 |
product_category INT NOT NULL, |
|
8 |
product_id INT NOT NULL, |
|
9 |
customer_id INT NOT NULL, |
|
10 |
PRIMARY KEY(no), |
|
11 |
INDEX (product_category, product_id), |
|
12 |
FOREIGN KEY (product_category, product_id) |
|
13 |
REFERENCES product(category, id) |
|
14 |
ON UPDATE CASCADE ON DELETE RESTRICT, |
|
15 |
INDEX (customer_id), |
|
16 |
FOREIGN KEY (customer_id) |
|
17 |
REFERENCES customer(id)) ENGINE=INNODB; |
|
18 |
show create table product_order; |
|
19 |
Table Create Table |
|
20 |
product_order CREATE TABLE `product_order` ( |
|
1743.5.2
by LinuxJedi
Alter many test cases for the new SHOW CREATE TABLE output |
21 |
`no` INT NOT NULL AUTO_INCREMENT, |
22 |
`product_category` INT NOT NULL, |
|
23 |
`product_id` INT NOT NULL, |
|
24 |
`customer_id` INT NOT NULL, |
|
2363.1.5
by Brian Aker
This patch fixes 798940, we will also just now add the type of index to our create statements. |
25 |
PRIMARY KEY (`no`) USING BTREE, |
26 |
KEY `product_category` (`product_category`,`product_id`) USING BTREE, |
|
27 |
KEY `customer_id` (`customer_id`) USING BTREE, |
|
1638.10.102
by Stewart Smith
merge trunk |
28 |
CONSTRAINT `product_order_ibfk_1` FOREIGN KEY (`product_category`, `product_id`) REFERENCES `product` (`category`, `id`) ON UPDATE CASCADE ON DELETE RESTRICT, |
1638.10.82
by Stewart Smith
fix some tests for explicit COLLATE in CREATE TABLE |
29 |
CONSTRAINT `product_order_ibfk_2` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) |
1638.10.69
by Stewart Smith
foreign_key.result with explicit COLLATE in SHOW CREATE TABLE |
30 |
) ENGINE=InnoDB COLLATE = utf8_general_ci |
722
by Brian Aker
Updated/fix to foreign key test. |
31 |
drop table product_order, customer, product; |
1
by brian
clean slate |
32 |
drop table if exists t_34455; |
33 |
create table t_34455 ( |
|
34 |
a int not null, |
|
35 |
foreign key (a) references t3 (a) match full match partial); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
36 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'match partial)' at line 3 |
1
by brian
clean slate |
37 |
create table t_34455 ( |
38 |
a int not null, |
|
39 |
foreign key (a) references t3 (a) on delete set default match full); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
40 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'match full)' at line 3 |
1
by brian
clean slate |
41 |
create table t_34455 ( |
42 |
a int not null, |
|
43 |
foreign key (a) references t3 (a) on update set default match full); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
44 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'match full)' at line 3 |
1
by brian
clean slate |
45 |
create table t_34455 ( |
46 |
a int not null, |
|
47 |
foreign key (a) references t3 (a) |
|
48 |
on delete set default on delete set default); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
49 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'delete set default)' at line 4 |
1
by brian
clean slate |
50 |
create table t_34455 ( |
51 |
a int not null, |
|
52 |
foreign key (a) references t3 (a) |
|
53 |
on update set default on update set default); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
54 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'update set default)' at line 4 |
1
by brian
clean slate |
55 |
create table t_34455 (a int not null); |
56 |
alter table t_34455 |
|
57 |
add foreign key (a) references t3 (a) match full match partial); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
58 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'match partial)' at line 1 |
1
by brian
clean slate |
59 |
alter table t_34455 |
60 |
add foreign key (a) references t3 (a) on delete set default match full); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
61 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'match full)' at line 1 |
1
by brian
clean slate |
62 |
alter table t_34455 |
63 |
add foreign key (a) references t3 (a) on update set default match full); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
64 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'match full)' at line 1 |
1
by brian
clean slate |
65 |
alter table t_34455 |
66 |
add foreign key (a) references t3 (a) |
|
67 |
on delete set default on delete set default); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
68 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'delete set default)' at line 2 |
1
by brian
clean slate |
69 |
alter table t_34455 |
70 |
add foreign key (a) references t3 (a) |
|
71 |
on update set default on update set default); |
|
722
by Brian Aker
Updated/fix to foreign key test. |
72 |
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near 'update set default)' at line 2 |
1
by brian
clean slate |
73 |
drop table t_34455; |