While running php maintenance/update.php, I get the following error:
Creating image_comment_temp table ...[4ecb262880f9524e5c0d24a1] [no req] Wikimedia\Rdbms\DBQueryError from line 1457 of /.../includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: CREATE TABLE `image_comment_temp` (
imgcomment_name varchar(255) binary NOT NULL,
imgcomment_description_id bigint unsigned NOT NULL,
PRIMARY KEY (imgcomment_name, imgcomment_description_id)
) ENGINE=InnoDB
Function: Wikimedia\Rdbms\Database::sourceFile( /.../maintenance/archives/patch-image_comment_temp-table.sql )
Error: 1071 Specified key was too long; max key length is 767 bytes (localhost)
Backtrace:
#0 /.../includes/libs/rdbms/database/Database.php(1427): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 /.../includes/libs/rdbms/database/Database.php(1200): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 /.../includes/libs/rdbms/database/Database.php(4194): Wikimedia\Rdbms\Database->query(string, string)
#3 /.../includes/libs/rdbms/database/Database.php(4129): Wikimedia\Rdbms\Database->sourceStream(unknown type, NULL, NULL, string, NULL)
#4 /.../includes/installer/DatabaseUpdater.php(683): Wikimedia\Rdbms\Database->sourceFile(string)
#5 /.../includes/installer/DatabaseUpdater.php(726): DatabaseUpdater->applyPatch(string, boolean, string)
#6 /.../includes/installer/DatabaseUpdater.php(482): DatabaseUpdater->addTable(string, string)
#7 /.../includes/installer/DatabaseUpdater.php(446): DatabaseUpdater->runUpdates(array, boolean)
#8 /.../maintenance/update.php(203): DatabaseUpdater->doUpdates(array)
#9 /.../maintenance/doMaintenance.php(94): UpdateMediaWiki->execute()
#10 /.../maintenance/update.php(248): require_once(string)
#11 {main}Other tickets suggest that this is the result of using utf8mb4, which is resulting in, well, primary keys longer than 767 bytes.
The only related code changes that I could find was T227662 (f1f96285b0aa), but I don't know if that's related.
| Product | Version |
|---|---|
| MediaWiki | 1.31.6 (c168a3f) 08:28, December 19, 2019 |
| PHP | 7.0.33-0+deb9u6 (apache2handler) |
| MariaDB | 10.1.41-MariaDB-0+deb9u1 |
| ICU | 57.1 |