Author: andrew
Description:
Steps to reproduce:
- On a fresh install of MediaWiki 1.11.0, using a PostgreSQL 8.1 database
- I edit the main page to insert an 'x' at the start (i.e. make an arbitrary change).
- Go to the 'History' page and click on 'Compare Selected Versions'.
The following result ensues because YYYYMMDDHHMMSS is not valid syntax for a timestamp. It should separate the date and time parts with a 'T' like '20071211T072639'. When I manually run the query with that edit it does not cause an error.
The full error detail is as follows:
A database error has occurred Query: SELECT * FROM recentchanges WHERE rc_timestamp = '20071211074158' AND rc_this_oldid = '2' AND rc_last_oldid = '1' AND rc_patrolled = '0' Function: DifferenceEngine::showDiffPage Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "20071211074158"
Backtrace:
#0 /usr/share/mediawiki/includes/Database.php(795): DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'SELECT * FROM...', 'DifferenceEngin...', false)
#1 /usr/share/mediawiki/includes/Database.php(1240): Database->query('SELECT * FROM...', 'DifferenceEngin...')
#2 /usr/share/mediawiki/includes/RecentChange.php(100): Database->select('recentchanges', '*', Array, 'DifferenceEngin...')
#3 /usr/share/mediawiki/includes/DifferenceEngine.php(177): RecentChange::newFromConds(Array, 'DifferenceEngin...')
#4 /usr/share/mediawiki/includes/Article.php(674): DifferenceEngine->showDiffPage(false)
#5 /usr/share/mediawiki/includes/Wiki.php(383): Article->view()
#6 /usr/share/mediawiki/includes/Wiki.php(48): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#7 /usr/share/mediawiki/index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
#8 {main}
Version: 1.11.x
Severity: critical