Author - Carlos Tutte

Using Referential Constraints with Partitioned Tables in InnoDB

partioned tables innodb

One of our support customers approached us with the following problem the other day:

Shell

mysql> CREATE TABLE child_table (
`id` int unsigned auto_increment,
`column1` varchar(64) NOT NULL,
parent_id int unsigned NOT NULL,
PRIMARY KEY (`id`),
CONSTRAINT FOREIGN KEY (parent_id) REFERENCES parent_table (id));
ERROR 1215 (HY000): Cannot add foreign key constraint

1234567

mysql> CREATE TABLE child_table (`id` int unsigned auto_increment,`column1` varchar(64) NOT NULL,parent_id int […]

Read more