Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0b4

Bug #19625 Can't create FK on tables with long names
Submitted: 2012-09-29 15:56 UTC
From: hschletz Assigned:
Status: Open Package: MDB2_Driver_mysql (version SVN)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2012-09-29 15:56 UTC] hschletz (Holger Schletz)
Description: ------------ _createFKTriggers() contains a hack to raise an error on FK constraint violation by calling a (hopefully) nonexistent procedure. The name of that procedure is composed of a descriptive message and the table name. Since MySQL limits procedure names to 64 characters, this fails with Error 1059 if the table name is longer than about 16 characters: Identifier name 'update_ON_TABLE_table_name_with more_than_16_characters_VIOLATES_FOREIGN_KEY_CONSTRAINT' is too long I have attached a patch that reduces the risk by shortening the message (and still being meaningful), so that the limit is not exceeded that easily. That's far from perfect because the table name limit is only extended, not removed. The procedure name should better be truncated to 64 characters, or use an alternative hack to deliver an error message that is not subject to that limitation.

Comments

 [2012-09-29 15:56 UTC] hschletz (Holger Schletz)