Last modified: 2013-10-23 18:17:17 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 36179 - rebuildall.php invalid input syntax for integer: "NULL" at character 149
rebuildall.php invalid input syntax for integer: "NULL" at character 149
Status: RESOLVED DUPLICATE of bug 31007
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
All Linux
: Low normal (vote)
: ---
Assigned To: Marcin Cieślak
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2012-04-23 15:25 UTC by David
Modified: 2013-10-23 18:17 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description David 2012-04-23 15:25:47 UTC
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:
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.
Comment 1 Mark A. Hershberger 2012-04-23 18:11:51 UTC
looks like this is pg specific.
Comment 2 David 2012-04-23 18:37:30 UTC
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
Comment 3 Mark A. Hershberger 2012-04-23 20:30:14 UTC
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" but that is just using a web search to find the answer.
Comment 4 Marcin Cieślak 2012-04-23 22:20:07 UTC
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).
Comment 5 Chad H. 2012-04-23 22:23:02 UTC
I believe this is the same as bug 31007 (fixed in r107964). Probably just wasn't backported to 1.18.x.
Comment 6 Tim Landscheidt 2012-09-19 14:49:36 UTC
Gerrit change #24293.

*** This bug has been marked as a duplicate of bug 31007 ***

Note You need to log in before you can comment on or make changes to this bug.