Enabling module throws error.

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: CREATE TABLE {block_morelink} ( `module` VARCHAR(64) NOT NULL COMMENT 'The block’s origin module, from block.module.', `delta` VARCHAR(32) NOT NULL COMMENT 'The block’s unique delta within module, from block.delta.', `url` VARCHAR(255) NOT NULL COMMENT 'The more link url of a block.', `title` VARCHAR(255) NOT NULL COMMENT 'The more link title of a block.', PRIMARY KEY (`module`, `delta`, `url`, `title`), INDEX `url` (`url`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Stores more link path.'; Array ( ) in db_create_table() (line 2588 of /home/hoslot5/public_html/includes/database/database.inc).

Comments

g089h515r806’s picture

Which drupal version do you use. I test on my machine, it works. This issue exist on drupal 6 version.
the reason is :
PRIMARY KEY (`module`, `delta`, `url`, `title`),

url and title are too long to be used as primary key, but it works on Drupal 7.

Starminder’s picture

At the time I wrote this I was trying to rescue an upgraded (D6.2 to D7) site.

g089h515r806’s picture

Status: Active » Reviewed & tested by the community

I have change the PRIMARY KEY from (`module`, `delta`, `url`, `title`) to (`module`, `delta`) in the latest code,
Please test it.

g089h515r806’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

juliaBrin’s picture

I suggest that you try Long Path Tool. I have the same problem as yours, but with this tool, I was able to manage it successfully.