Last modified: 2012-08-04 20:48:44 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T17833, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15833 - Special:CheckUser causes errors with PostgreSQL
Special:CheckUser causes errors with PostgreSQL
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CheckUser (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Aaron Schulz
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2008-10-04 20:29 UTC by Brad Jorsch
Modified: 2012-08-04 20:48 UTC (History)
0 users

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


Attachments
Patch for the three remaining errors in r41668 (1.40 KB, patch)
2008-10-04 22:25 UTC, Brad Jorsch
Details

Description Brad Jorsch 2008-10-04 20:29:29 UTC
Using Special:CheckUser's "Account Edits" or "Get edits from IP" options with a database that uses real timestamps (e.g. PostgreSQL) causes a number of errors similar to the following to be output:

Notice: Undefined offset: -2 in /usr/local/src/MediaWiki/phase3/languages/Language.php on line 423

Notice: Undefined offset: -1 in /usr/local/src/MediaWiki/phase3/languages/Language.php on line 423

Language::sprintfDate and Language::timeanddate both expect a YYYYMMDDHHMMSS format timestamp, but CheckUser_body.php is passing it whatever is returned from the database. One possible fix is to run any timestamps retrieved from the database through wfTimestamp() (with the TS_MW option) before passing them to these functions.


Also, using any of the Duration options besides "all" causes a database error, as PostgreSQL does not recognize the "YYYYMMDDHHMMSS" format as a valid input format for timestamps. The fix here seems to be to use the $dbr->timestamp() method to convert the timestamp into the appropriate format for the database before using it in the SQL query.


All of this was tested using a local installation of MediaWiki r41664, the CheckUser extension as of r41664, and PostgreSQL 8.3.4.
Comment 1 Aaron Schulz 2008-10-04 22:09:00 UTC
Fixed in r41668
Comment 2 Brad Jorsch 2008-10-04 22:25:29 UTC
Created attachment 5388 [details]
Patch for the three remaining errors in r41668

Three timestamps were missed in r41668. This patch fixes them in the same style as r41668.
Comment 3 Aaron Schulz 2008-10-04 22:38:12 UTC
Rest done in r41670

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


Navigation
Links