Setup
- MediaWiki | 1.39.7 (64425c7)16:12, 15 May 2024
- PHP | 7.4.33 (apache2handler)
- MariaDB | 10.5.23-MariaDB-0+deb11u1
Issue
When running "update.php" for the direct upgrade from MW 1.35.x to 1.39.x I got the following error:
Modifying pp_page field of table page_props...Wikimedia\Rdbms\DBQueryError from line 1618 of /../w/includes/libs/rdbms/database/Database.php: Error 1264: Out of range value for column 'pp_page' at row 1 Function: Wikimedia\Rdbms\Database::sourceFile( /../w/maintenance/archives/patch-page_props-pp_page.sql ) Query: ALTER TABLE `02100_page_props` CHANGE pp_page pp_page INT UNSIGNED NOT NULL
Backtrace
#0 /../w/includes/libs/rdbms/database/Database.php(1602): Wikimedia\Rdbms\Database->getQueryException() #1 /../w/includes/libs/rdbms/database/Database.php(1576): Wikimedia\Rdbms\Database->getQueryExceptionAndLog() #2 /../w/includes/libs/rdbms/database/Database.php(952): Wikimedia\Rdbms\Database->reportQueryError() #3 /../w/includes/libs/rdbms/database/Database.php(3302): Wikimedia\Rdbms\Database->query() #4 /../w/includes/libs/rdbms/database/Database.php(3241): Wikimedia\Rdbms\Database->sourceStream() #5 /../w/includes/libs/rdbms/database/DBConnRef.php(103): Wikimedia\Rdbms\Database->sourceFile() #6 /../w/includes/libs/rdbms/database/DBConnRef.php(807): Wikimedia\Rdbms\DBConnRef->__call() #7 /../w/includes/installer/DatabaseUpdater.php(718): Wikimedia\Rdbms\DBConnRef->sourceFile() #8 /../w/includes/installer/DatabaseUpdater.php(1000): DatabaseUpdater->applyPatch() #9 /../w/includes/installer/DatabaseUpdater.php(547): DatabaseUpdater->modifyField() #10 /../w/includes/installer/DatabaseUpdater.php(511): DatabaseUpdater->runUpdates() #11 /../w/maintenance/update.php(209): DatabaseUpdater->doUpdates() #12 /../w/maintenance/includes/MaintenanceRunner.php(309): UpdateMediaWiki->execute() #13 /../w/maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run() #14 /../w/maintenance/update.php(319): require_once('/var/www/html/s...') #15 {main}
Further info
Query:
SELECT MAX(pp_page) AS max_pp_page, MIN(pp_page) AS min_pp_page FROM `02100_page_props`;
Result:
+-------------+-------------+ | max_pp_page | min_pp_page | +-------------+-------------+ | 16459 | -42 | +-------------+-------------+ 1 row in set (0,000 sec)
Mitigation
Query:
UPDATE `02100_page_props` SET pp_page = 0 WHERE pp_page < 0;
Result:
Query OK, 1 row affected (0,001 sec) Rows matched: 1 Changed: 1 Warnings: 0
followed by the query that initially failed (w/maintenance/archives/patch-page_props-pp_page.sql):
Query:
ALTER TABLE `02100_page_props` CHANGE `pp_page` `pp_page` INT UNSIGNED NOT NULL;
Result:
Query OK, 13107 rows affected (0,198 sec) Records: 13107 Duplicates: 0 Warnings: 0
After that, I was able to continue with "update.php." I am unsure where this issue may have originated and whether my way of mitigating it is recommended. Anyhow, now on MW 1.39.x, the wiki appears to be running without issues, at least none have been detected yet.
This issue was mentioned and is referenced on MediaWiki.org - Support desk.