Page MenuHomePhabricator

"WHERE (rev_id BETWEEN 0 AND )" claused created by PopulateIpChanges::doDBUpdates
Closed, ResolvedPublic

Description

In the process of upgrading to 1.30, ran update.php and hit:

Copying IP revisions to ip_changes, from rev_id 0 to rev_id
[a57cd2553df01cf4db2eb86b] [no req]   Wikimedia\Rdbms\DBQueryError from line 1149 of /var/www/mediawiki/core/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: SELECT  rev_id,rev_timestamp,rev_user_text  FROM `revision`    WHERE (rev_id BETWEEN 0 AND ) AND rev_user = '0'
Function: PopulateIpChanges::doDBUpdates
Error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AND rev_user = '0'' at line 1 (localhost)

Backtrace:
#0 /var/www/mediawiki/core/includes/libs/rdbms/database/Database.php(979): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#1 /var/www/mediawiki/core/includes/libs/rdbms/database/Database.php(1343): Wikimedia\Rdbms\Database->query(string, string)
#2 /var/www/mediawiki/core/maintenance/populateIpChanges.php(91): Wikimedia\Rdbms\Database->select(string, array, array, string)
#3 /var/www/mediawiki/core/maintenance/Maintenance.php(1581): PopulateIpChanges->doDBUpdates()
#4 /var/www/mediawiki/core/maintenance/update.php(216): LoggedUpdateMaintenance->execute()
#5 /var/www/mediawiki/core/maintenance/doMaintenance.php(92): UpdateMediaWiki->execute()
#6 /var/www/mediawiki/core/maintenance/update.php(249): require_once(string)
#7 /var/www/mediawiki/core/maintenance.php(43): include(string)
#8 {main}

In case it's useful:

# mysql --version
mysql  Ver 15.1 Distrib 10.0.33-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Event Timeline

Legoktm created this task.Feb 26 2018, 3:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 26 2018, 3:56 AM

Change 414721 had a related patch set uploaded (by MusikAnimal; owner: MusikAnimal):
[mediawiki/core@master] Cast max revision ID into integer in populateIpChanges

https://gerrit.wikimedia.org/r/414721

Looks like in your case there were no revisions.

Change 414721 merged by jenkins-bot:
[mediawiki/core@master] Exit populateIpChanges maintenance script if there are no revisions

https://gerrit.wikimedia.org/r/414721

Change 414761 had a related patch set uploaded (by Legoktm; owner: MusikAnimal):
[mediawiki/core@REL1_30] Exit populateIpChanges maintenance script if there are no revisions

https://gerrit.wikimedia.org/r/414761

MusikAnimal closed this task as Resolved.Feb 26 2018, 8:52 PM

Change 414761 merged by jenkins-bot:
[mediawiki/core@REL1_30] Exit populateIpChanges maintenance script if there are no revisions

https://gerrit.wikimedia.org/r/414761