Bug #46661 Support For Foreign Keys In Partitioned Tables
Submitted: 11 Aug 2009 20:56 Modified: 22 Dec 2009 10:03
Reporter: Greg Wittel Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Partitions Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: partitioning foreign key

[11 Aug 2009 20:56] Greg Wittel
Description:
Currently MySQL 5.1 partitioning support is limited to tables that do not contain foreign key references and are not referenced by any other table's FK constraints.  This severely limits the use of partitioning to systems that do not enforce referential integrity.

How to repeat:
N/A

Suggested fix:
The documentation states:

> Foreign keys not supported.   Partitioned tables do not support foreign keys.
> This means that:
> 
>   1. Definitions of tables employing user-defined partitioning may not contain foreign key references to other tables.
>   2. No table definition may contain a foreign key reference to a partitioned table.

Both of these issues should be resolved for all common storage engines that support foreign keys (including InnoDB).

Workarounds such as using insert/delete/update triggers to enforce integrity are not sufficient.
[11 Aug 2009 21:09] MySQL Verification Team
Thank you for the bug report.
[18 Aug 2009 20:40] Peter Gulutzan
We take care of this in a future version, code already exists, see:
http://forge.mysql.com/worklog/task.php?id=148
[22 Dec 2009 10:03] Mattias Jonsson
Duplicate feature request of bug#46012. Work in progress WL#148.