Page MenuHomePhabricator

rebuildall.php invalid input syntax for integer: "NULL" at character 149
Closed, ResolvedPublic

Description

Author: dathku

Description:
Product Version
MediaWiki 1.18.2
PHP 5.3.8 (apache2handler)
PostgreSQL 9.0.4

When I run the rebuildall.php I am getting this error

Error: 1 ERROR: invalid input syntax for integer: "NULL" at character 149

Here is the stack trace

  • Rebuilding recentchanges table:

Loading from page and revision tables...
$wgRCMaxAge=7862400 (91 days)
Updating links and size differences...
PHP Warning: pg_query(): Query failed: ERROR: invalid input syntax for integer: "NULL" at character 149 in /usr/local/mediawiki/includes/db/DatabasePostgres.php on line 253
PHP Stack trace:
PHP 1. {main}() /usr/local/mediawiki/maintenance/rebuildall.php:0
PHP 2. require_once() /usr/local/mediawiki/maintenance/rebuildall.php:55
PHP 3. RebuildAll->execute() /usr/local/mediawiki/maintenance/doMaintenance.php:105
PHP 4. RebuildRecentchanges->execute() /usr/local/mediawiki/maintenance/rebuildall.php:43
PHP 5. RebuildRecentchanges->rebuildRecentChangesTablePass2() /usr/local/mediawiki/maintenance/rebuildrecentchanges.php:35
PHP 6. DatabaseBase->update() /usr/local/mediawiki/maintenance/rebuildrecentchanges.php:148
PHP 7. DatabaseBase->query() /usr/local/mediawiki/includes/db/Database.php:1669
PHP 8. DatabasePostgres->doQuery() /usr/local/mediawiki/includes/db/Database.php:802
PHP 9. pg_query() /usr/local/mediawiki/includes/db/DatabasePostgres.php:253
A database error has occurred. Did you forget to run maintenance/update.php after upgrading? See: http://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: UPDATE "recentchanges" SET rc_last_oldid = '0',rc_new = '1',rc_type = '1',rc_old_len = 'NULL',rc_new_len = '27' WHERE rc_cur_id = '21' AND rc_this_oldid = '150'
Function: RebuildRecentchanges::rebuildRecentChangesTablePass2
Error: 1 ERROR: invalid input syntax for integer: "NULL" at character 149

I have run update.php and that seems to run fine without throwing any errors.


Version: 1.18.x
Severity: normal
OS: Linux

Details

Reference
bz36179

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:20 AM
bzimport set Reference to bz36179.

dathku wrote:

I have tried an install on the same box with a mysql database and that one did not have any problems with running the rebuildall.php it only seems to be happening on the instance that is connected to my pgsql database

Adding Marcin to look at this. It looks like the PG handler should do the right thing if passed PHP's null value instead of a string that says "NULL" http://stackoverflow.com/questions/1027499/postgresql-using-null-value-when-insert-and-update-rows-with-prepared-stateme but that is just using a web search to find the answer.

Database layer converts PHP null into proper SQL unquoted NULLs, so something else must be a problem. I would be grateful for the database dump from the reporter to reproduce the issue, if possible (don't publish it here - post it to my email address instead).

I believe this is the same as bug 31007 (fixed in r107964). Probably just wasn't backported to 1.18.x.

Gerrit change 24293.

  • This bug has been marked as a duplicate of bug 31007 ***
Jdforrester-WMF subscribed.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.