Last modified: 2012-08-04 20:48:43 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 T20863, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18863 - SELECT ... LIMIT fails on PostgreSQL
SELECT ... LIMIT fails on PostgreSQL
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
NewestPages (Other open bugs)
unspecified
All All
: Normal minor (vote)
: ---
Assigned To: Rob Church
: patch
Depends on:
Blocks: postgres
  Show dependency treegraph
 
Reported: 2009-05-21 12:19 UTC by Hans Spaans
Modified: 2012-08-04 20:48 UTC (History)
2 users (show)

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


Attachments
Rewrite LIMIT #,# to LIMIT # OFFSET # (818 bytes, patch)
2009-05-21 12:19 UTC, Hans Spaans
Details
Rewrite of mwe-newestpages-r50851-hspaans-1.patch (1.00 KB, patch)
2009-05-31 21:15 UTC, Hans Spaans
Details

Description Hans Spaans 2009-05-21 12:19:49 UTC
Created attachment 6142 [details]
Rewrite LIMIT #,# to LIMIT # OFFSET #

The current SELECT statement fails on PostgreSQL since it doesn't support LIMIT #,#, but both MySQL and PostgreSQL do support LIMIT # OFFSET #. The patch attached should make the SELECT statement work with both MySQL and PostgreSQL.

http://dev.mysql.com/doc/refman/5.1/en/select.html
http://www.postgresql.org/docs/8.3/static/sql-select.html
Comment 1 Brion Vibber 2009-05-26 21:05:28 UTC
This should be using database abstraction functions -- in this case it should be possible to build the query more cleanly with Database::select(); alternately at least use Database::limitOffset() to generate the LIMIT/OFFSET portions in a way that'll work for the DB backend in use.
Comment 2 Hans Spaans 2009-05-31 21:15:05 UTC
Created attachment 6180 [details]
Rewrite of mwe-newestpages-r50851-hspaans-1.patch
Comment 3 Siebrand Mazeland 2009-06-01 17:00:59 UTC
Applied in r51295. Thanks.

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


Navigation
Links