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.

Comments

mygumbo created an issue. See original summary.

jaesperanza’s picture

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 /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 /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 (do not forget to remove the same lines before running updb again):

$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

rszrama’s picture

Status: Active » Fixed

Thanks for sharing a solution!

Status: Fixed » Closed (fixed)

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