Last modified: 2012-08-04 20:49:12 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 T15532, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 13532 - Reverting Images broken
Reverting Images broken
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.13.x
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2008-03-27 07:56 UTC by OverlordQ
Modified: 2012-08-04 20:49 UTC (History)
2 users (show)

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


Attachments

Description OverlordQ 2008-03-27 07:56:22 UTC
YATB (Yet Another Timestamp Bug).

Trying to revert an image results in this error:

====
A database error has occurred Query: SELECT oi_size,oi_width,oi_height,oi_bits,oi_media_type,oi_major_mime,oi_minor_mime,oi_metadata,oi_timestamp,oi_sha1,oi_user,oi_user_text,oi_description,oi_archive_name,oi_deleted FROM oldimage WHERE oi_name = 'Smiley.svg' AND (oi_timestamp <= '20080327074730!Smiley.svg') ORDER BY oi_timestamp DESC LIMIT 1 Function: OldLocalFile::loadFromDB Error: 1 ERROR: invalid input syntax for type timestamp with time zone: "20080327074730!Smiley.svg"

Backtrace:

#0 /home/wiki/includes/Database.php(799): DatabasePostgres->reportQueryError('ERROR: invalid...', 1, 'SELECT oi_size...', 'OldLocalFile::l...', false)
#1 /home/wiki/includes/Database.php(1244): Database->query('SELECT oi_size...', 'OldLocalFile::l...')
#2 /home/wiki/includes/Database.php(1263): Database->select('oldimage', Array, Array, 'OldLocalFile::l...', Array)
#3 /home/wiki/includes/filerepo/OldLocalFile.php(174): Database->selectRow('oldimage', Array, Array, 'OldLocalFile::l...', Array)
#4 /home/wiki/includes/filerepo/LocalFile.php(248): OldLocalFile->loadFromDB()
#5 /home/wiki/includes/filerepo/LocalFile.php(450): LocalFile->load()
#6 /home/wiki/includes/filerepo/FileRepo.php(91): LocalFile->exists()
#7 /home/wiki/includes/filerepo/RepoGroup.php(66): FileRepo->findFile(Object(Title), '20080327074730!...')
#8 /home/wiki/includes/GlobalFunctions.php(2346): RepoGroup->findFile(Object(Title), '20080327074730!...')
#9 /home/wiki/includes/FileRevertForm.php(137): wfFindFile(Object(Title), '20080327074730!...')
#10 /home/wiki/includes/FileRevertForm.php(58): FileRevertForm->haveOldVersion()
#11 /home/wiki/includes/ImagePage.php(502): FileRevertForm->execute()
#12 /home/wiki/includes/Wiki.php(447): ImagePage->revert()
#13 /home/wiki/includes/Wiki.php(59): MediaWiki->performAction(Object(OutputPage), Object(ImagePage), Object(Title), Object(User), Object(WebRequest))
#14 /home/wiki/index.php(92): MediaWiki->initialize(Object(Title), Object(ImagePage), Object(OutputPage), Object(User), Object(WebRequest))
#15 {main}
=====

20080327074730!Smiley.svg (oi_archive_name) is most definitely not a valid timestamp.
Comment 1 Greg Sabino Mullane 2008-03-27 21:55:55 UTC
Thanks, should be fixed in r32526.
Comment 2 OverlordQ 2008-03-30 06:32:21 UTC
The error isn't there but now when reverting all you get is:

===
There is no previous local version of this file with the provided timestamp.
===
Comment 3 Greg Sabino Mullane 2008-04-01 04:40:01 UTC
That's hard to debug. Can you check the link on the page it came from and compare to the info in the database?
Comment 4 OverlordQ 2008-04-01 07:44:40 UTC
Just to make it easier I uploaded a small test image and replaced it once with a similar image.

http://www.thedarkcitadel.com/wiki/Image:Test.png

The first revert link is:
http://www.thedarkcitadel.com/w/index.php?title=Image:Test.png&action=revert&oldimage=20080401073840%21Test.png&wpEditToken=baleeted

DB:
====
SELECT * FROM mediawiki.image WHERE img_name = 'Test.png';
 img_name | img_size | img_width | img_height | img_metadata | img_bits | img_media_type | img_major_mime | img_minor_mime | img_description | img_user | img_user_text |     img_timestamp      |            img_sha1
----------+----------+-----------+------------+--------------+----------+----------------+----------------+----------------+-----------------+----------+---------------+------------------------+---------------------------------
 Test.png |     1136 |        85 |         62 | 0            |        8 | BITMAP         | image          | png            | test2           |        1 | OverlordQ     | 2008-04-01 02:38:40-05 | p67o12rr7u25qrqw835mb0ym0v6cynd

---

SELECT * FROM mediawiki.oldimage WHERE oi_name = 'Test.png';
 oi_name  |     oi_archive_name     | oi_size | oi_width | oi_height | oi_bits | oi_description | oi_user | oi_user_text |      oi_timestamp      | oi_metadata | oi_media_type | oi_major_mime | oi_minor_mime | oi_deleted |             oi_sha1      
----------+-------------------------+---------+----------+-----------+---------+----------------+---------+--------------+------------------------+-------------+---------------+---------------+---------------+------------+---------------------------------
 Test.png | 20080401073840!Test.png |    1152 |       85 |        62 |       8 | test           |       1 | OverlordQ    | 2008-04-01 02:37:19-05 | 0           | BITMAP        | image         | png           |          0 | k4iyxkor2h2mhjq73i2wckvp8hgdty5
Comment 5 OverlordQ 2008-04-01 07:46:14 UTC
Wow that's horribly mutilated:

http://www.thedarkcitadel.com/~ovrlrdq/sql.txt

Comment 6 Tim Starling 2008-04-05 16:48:50 UTC
The bug wasn't PostgreSQL-specific, it was just slightly noisier in PostgreSQL than in MySQL. Fixed in r13532.

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


Navigation
Links