Page MenuHomePhabricator

Wrong timestamp format in Postgres
Closed, ResolvedPublic

Description

Author: dwilches

Description:
Hi. An error happened in my wiki while trying to see the "diff" between an article's revisions. I'm using PostgreSQL. The error is related to an invalid timestamp format in the selection.

Here is the complete error message:

A database error has occurred Query: SELECT * FROM recentchanges WHERE rc_timestamp = '20080215154313' AND rc_this_oldid = '556' AND rc_last_oldid = '416' AND rc_patrolled = '0' Function: DifferenceEngine::showDiffPage Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "20080215154313"

Backtrace:

#0 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\Database.php(779): DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'SELECT * FROM...', 'DifferenceEngin...', false)
#1 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\Database.php(1224): Database->query('SELECT * FROM...', 'DifferenceEngin...')
#2 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\RecentChange.php(100): Database->select('recentchanges', '*', Array, 'DifferenceEngin...')
#3 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\DifferenceEngine.php(177): RecentChange::newFromConds(Array, 'DifferenceEngin...')
#4 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\Article.php(674): DifferenceEngine->showDiffPage(false)
#5 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\Wiki.php(383): Article->view()
#6 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\includes\Wiki.php(48): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#7 D:\Apache Software Foundation\Apache2.2\htdocs\wiki\index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#8 {main}


Version: unspecified
Severity: enhancement

Details

Reference
bz13026

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.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:07 PM
bzimport set Reference to bz13026.
bzimport added a subscriber: Unknown Object (MLST).

What version of MediaWiki was this? Have you tried the latest subversion revision? Bugs related to this issue have been fixed, so it may have already been solved.

harding.ian wrote:

  • MediaWiki: 1.11.1
  • PHP: 5.2.2 (apache2handler)
  • PostgreSQL: PostgreSQL 8.2.6 on x86_64--netbsd, compiled by GCC gcc (GCC) 3.3.3 (NetBSD nb3 20040520)

Still happens for me. This is the current release, but I don't keep up with the chages in-between releases.

overlordq wrote:

These 'should' be fixed in the latest revisions, of which 1.11.2/1.12 are due soonish (according to #mediawiki)

I can confirm this bug still exists in 1.11.2

... and in a svn checkout of 1.12 :-(

overlordq wrote:

I've been running svn version and I can say I've never an into this problem.

Worked fine for me since atleast r28000 or thereabouts whenever I installed it.

That is very odd, and unlikely to be a postgres version divergence since 'YYYYMMDDHHMMSS' as a numeric value has never been a valid timestamp with timezone value as far as I can tell, and I still get

Query failed: ERROR: invalid input syntax for type timestamp with time zone: "20080315022740" in /var/www/codex/site/includes/DatabasePostgres.php on line 506

I'm running off a svn checkout of R1_12 that's currently at r32018. Could it have been fixed in 1_11 and not in 1_12?

Running the 1.12 maintenance/update.php script (in 1_12 svn) apparently twiddled with the schema to fix it. It now works for me.

Jdforrester-WMF subscribed.

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