Upgrade from 7-1.15 to 7-1.17 key length error

Created on 29 July 2022, almost 2 years ago
Updated 2 October 2023, 9 months ago

When upgrading from 7-1.15 to 7-1.17

running upgrade.php throws this error:

Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {commerce_order} ADD INDEX `order_id_status_type` (`order_id`, `status`, `type`); Array ( ) in db_add_index() (line 3077 of /[...]/www/includes/database/database.inc).

Thanks for any ideas.

πŸ’¬ Support request
Status

Fixed

Version

1.17

Component

Commerce

Created by

πŸ‡ΊπŸ‡ΈUnited States mygumbo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡΅πŸ‡­Philippines jaesperanza

    An old issue, but persistent error for some on latest D7.x core and module versions. In case this helps anyone still running on D7, see below. Encountered the same both for commerce and panels modules, same error:

    commerce_order module
    Update #7113
    Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {commerce_order} ADD INDEX `order_id_status_type` (`order_id`, `status`, `type`); Array ( ) in db_add_index() (line 3077 of /home/ibuildp1/public_html/plaridel.ibuildph.com/includes/database/database.inc).

    panels module
    Update #7309
    Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {panels_allowed_types} ADD PRIMARY KEY (`module`, `type`); Array ( ) in db_add_primary_key() (line 3027 of /home/ibuildp1/public_html/plaridel.ibuildph.com/includes/database/database.inc).

    What helped:

    For commerce_order module, skip the errors temporarily by placing the following in settings.php until you get to run update.php again successfully:

    $conf['skip_order_update_7113'] = TRUE;
    $conf['skip_order_update_7114'] = TRUE;

    For panels error:
    executing SQL (for instance in your PHPMyAdmin) ALTER TABLE `panels_allowed_types` ENGINE=InnoDB;

    on both, run update.php again

  • Status changed to Fixed 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    Thanks for sharing a solution!

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

Production build 0.69.0 2024