Last modified: 2010-06-15 18:52:34 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 T25773, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23773 - SQL syntax trouble with postgresql when adding an image
SQL syntax trouble with postgresql when adding an image
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
FlaggedRevs (Other open bugs)
unspecified
All All
: Normal major (vote)
: ---
Assigned To: Chad H.
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-03 15:14 UTC by nicolas_albert
Modified: 2010-06-15 18:52 UTC (History)
2 users (show)

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


Attachments

Description nicolas_albert 2010-06-03 15:14:26 UTC
When uploading an image in a wiki in which FlaggedRevs is installed
upload crashes because of syntax error in postgresql : 

Warning:  pg_query() [function.pg-query]: Query failed: ERREUR:  la colonne « oldimage.oi_archive_name » doit apparaître dans la clause GROUP BY ou doit être utilisé dans une fonction d'agrégat in /var/www/wikiVespa/includes/db/DatabasePostgres.php on line 580

A database error has occurred
Query: SELECT oi_name,oi_archive_name,oi_size,oi_width,oi_height,oi_metadata,oi_bits,oi_media_type,oi_major_mime,oi_minor_mime,oi_description,oi_user,oi_user_text,oi_timestamp,oi_deleted,oi_sha1,MAX(fr_quality) AS fr_quality FROM oldimage LEFT JOIN flaggedrevs ON ((oi_sha1 = fr_img_sha1 AND oi_timestamp = fr_img_timestamp)) WHERE (oi_name = 'Vespa.jpg') GROUP BY oi_name,oi_timestamp ORDER BY oi_timestamp DESC LIMIT 50
Function: LocalFile::getHistory
Error: 1 ERREUR: la colonne « oldimage.oi_archive_name » doit apparaître dans la clause GROUP BY ou doit être utilisé dans une fonction d'agrégat

Backtrace:

#0 /var/www/wikiVespa/includes/db/Database.php(616): DatabasePostgres->reportQueryError('ERREUR: la col...', 1, 'SELECT oi_name...', 'LocalFile::getH...', false)
#1 /var/www/wikiVespa/includes/db/Database.php(1026): Database->query('SELECT oi_name...', 'LocalFile::getH...')
#2 /var/www/wikiVespa/includes/filerepo/LocalFile.php(651): Database->select(Array, Array, Array, 'LocalFile::getH...', Array, Array)
#3 /var/www/wikiVespa/includes/ImagePage.php(984): LocalFile->getHistory(50, '', NULL, false)
#4 /var/www/wikiVespa/includes/ImagePage.php(944): ImageHistoryPseudoPager->doQuery()
#5 /var/www/wikiVespa/includes/ImagePage.php(551): ImageHistoryPseudoPager->getBody()
#6 /var/www/wikiVespa/includes/ImagePage.php(122): ImagePage->imageHistory()
#7 /var/www/wikiVespa/includes/Wiki.php(450): ImagePage->view()
#8 /var/www/wikiVespa/includes/Wiki.php(63): MediaWiki->performAction(Object(OutputPage), Object(ImagePage), Object(Title), Object(User), Object(WebRequest))
#9 /var/www/wikiVespa/index.php(116): MediaWiki->initialize(Object(Title), Object(ImagePage), Object(OutputPage), Object(User), Object(WebRequest))
#10 {main}





Suggestion : 
replace line 1383 in FlaggedRevs.hooks.php: 

 $opts['GROUP BY'] = 'oi_name,oi_timestamp';

with this one : 

 $opts['GROUP BY'] = 'oi_name,oi_timestamp,oi_archive_name,oi_size,oi_width,oi_height,oi_metadata,oi_bits,oi_media_type,oi_major_mime,oi_minor_mime,oi_description,oi_user,oi_user_text,oi_deleted,oi_sha1';

(maybe putting fields in other order).
Comment 1 Chad H. 2010-06-15 18:52:34 UTC
Done in r68100

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


Navigation
Links