I got the following error after running update.php

The following updates returned messages
block_class module
Update #7100

Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {block_class} ADD PRIMARY KEY (`module`, `delta`); Array ( ) in db_add_primary_key() (line 2862 of /home/financ10/public_html/includes/database/database.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bradsmithcpa’s picture

I fixed the issue. I uninstalled block class then reinstalled without incident.

DYdave’s picture

Status: Active » Fixed

Hi bradsmithcpa,

Thanks for reporting this issue.

We're glad you were able to find a proper solution and work this out.
It seems this problem hasn't reappeared or beem reported by any other users for a while (last update almost 5 months ago), so I suggest we mark this issue as fixed for now.

Feel free to change again the status to active or needs work, or open a new issue, at any time, if you encounter any more problems with this particular item.

Any questions, feedback, comments, testing or reporting would be highly appreciated.
Thanks in advance for your comments and replies.
Cheers!

scottsperry’s picture

I got the same error. I am going from Drupal 6 to Drupal 7.

Looking at the table module and delta are varchar(255). Looking at the .install, they should be varchar(64) for module and varchar(32) for delta. I believe it is block_class_update_7100() which is setting them to varchar(255).

It looks like block_class_update_7101 fixes this, but too late for block_class_update_7100.

Status: Fixed » Closed (fixed)

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

vrwired’s picture

Reportedly, I can confirm #3 was the problem and solution. I also was upgrading from 6 to 7, had same error as comment #1, and edited the varchar in function block_class_update_7100 within install.module to be 'length' => 64 and 'length' => 32 for module and delta, respectively. I ran update and had no issues.

DYdave’s picture

Hi guys,

Thanks a lot guys for the follow-up, feedback and reporting.

Initially, I changed the status to fixed because I didn't have much further reporting/testing on this.

But now, given the great comments at #3 and with a confirmation at #5, I've decided to re-open this and submit a patch according to the revisions suggested.

This seems indeed to be a bug and Please find attached to this comment a patch against block_class-7.x-1.x at 53462df corresponding to the changes suggested at #3 and #5:
File attached as: block_class-PDOException-specified-key-was-too-long-1838014-6.patch

I would greatly appreciate to have your feedback, testing, reporting, questions, comments, reviews, or suggestions for this patch.

Feel free to let me know if you would have any further comments, issues, questions, objections, recommendations, suggestions, testing, reporting or concerns on the attached patch or any other aspects in this ticket in general, I would be glad to provide more information or explain in further details.

Thanks in advance to all for your reviews, testing, reporting and feedback.
Cheers!

DYdave’s picture

Version: 7.x-1.2 » 7.x-1.x-dev

Changing version to 7.x-1.x-dev branch.

Thanks in advance to everyone for your testing, reporting and feedback.
Cheers!

avguy’s picture

This patch fixed the problem for me. Thanks!

DYdave’s picture

Status: Needs review » Fixed

Thanks very much @avguy for your kind follow up and feedback on this patch and issue.

After more than two weeks, with no particular objections or further issues on this ticket, I went ahead and got it committed against the 7.x-1.x branch at 2cd165a.

I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this patch (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on any aspects in the commits or this ticket in general, I would be glad to provide more information or explain in more details.

Special thanks to @scottsperry and @vrwired for clearly reporting how they fixed this issue.
Thanks again to everyone for your help, reviews, feedback and comments on this issue.
Cheers!

Status: Fixed » Closed (fixed)

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

UpTil4Music’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Closed (fixed) » Patch (to be ported)

Finally getting around to upgrading a D6 site, and this baby is still raising it's ugly head in 7.x-2.x. Patch works against 7.x-2.1.

DYdave’s picture

Status: Patch (to be ported) » Needs review
FileSize
872 bytes

Hi @UpTil4Music,

Thanks a lot for following up on this issue and I certainly apologize for this late reply, but it has taken me some time to be able to get back to this module's issue queue.

I've ported the exact same changes from the patch posted at #6 to the 7.x-2.x version, basically changing two lines:
File attached as: block_class-7.x-2.x-PDOException-specified-key-was-too-long-1838014-12.patch

I really haven't tested this patch, so I would greatly appreciate to have your feedback, testing, reporting, questions, comments, reviews, or suggestions for this patch ported from 7.x-1.x to 7.x-2.x.

If the feedback is positive, this patch will most likely get committed at some point.

Feel free to let me know if you would have any further comments, issues, questions, objections, recommendations, suggestions, testing, reporting or concerns on the attached patch or any other aspects in this ticket in general, I would be glad to provide more information or explain in further details.

Thanks in advance to all for your reviews, testing, reporting and feedback.
Cheers!

Status: Needs review » Needs work

Status: Needs work » Needs review

  • DYdave committed f062706 on 7.x-2.x authored by kenorb
    Issue #2128271 by kenorb: Fixed PDOException - Specified key was too...
DYdave’s picture

Status: Needs review » Fixed

Hi guys,

I should have gone through the issue queue more carefully:
This issue was actually addressed in a related ticket #2128271: PDOException - Specified key was too long (2.x branch) with a tested valid patch.

Since the patch was ported and committed in another issue, I allowed myself to mark it as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this ticket or related commit f062706 (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on this bug report in general, I would be glad to provide more information or explain in more details.

Thanks again for your testing, reviews, feedback and comments on this issue.
Cheers!

Status: Fixed » Closed (fixed)

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