Bug #52130 Error is coming while adding the foreign keys to table columns of engine InnoDB
Submitted: 17 Mar 2010 10:05 Modified: 17 Mar 2010 12:27
Reporter: krishna reddy Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:5.0,5.5 OS:Any
Assigned to: CPU Architecture:Any

[17 Mar 2010 10:05] krishna reddy
Description:
Hi,
   I am getting the error while adding the foreign key constraints to the table columns.Here One of my table of DB Engine type InnoDB having more than 64 foreign keys.

Error is Too Many Keys specified:max 64 keys allowed.

what will be the maximum limit for foreign keys to be created for a table of DB Engine Type InnoDB?

Regards,
Krishna Reddy.B

How to repeat:
Please find the attached script to replicate the issue.
[17 Mar 2010 10:06] krishna reddy
sql file consists the statements to test this bug.

Attachment: test_foreign_key_limit.sql (application/octet-stream, text), 11.35 KiB.

[17 Mar 2010 12:21] Valeriy Kravchuk
There is a documented limitation of up to 64 indexes per table in MySQL (see http://dev.mysql.com/doc/refman/5.1/en/features.html for example), and index must be created for every foreign key (see http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html). Hence the limitation you reported.
[17 Mar 2010 12:27] krishna reddy
Hi,

In my application,one of the table having 130 foreign keys.To support this is there any option to configure/increase the max limit of keys.

Regards,
Krishna Reddy.B