Last modified: 2014-07-21 17:06:11 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 T69594, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67594 - Postgresql: non-integer constant in ORDER BY
Postgresql: non-integer constant in ORDER BY
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All Linux
: Unprioritized major with 1 vote (vote)
: 1.24.0 release
Assigned To: Jeff Janes
Depends on:
Blocks: postgres
  Show dependency treegraph
Reported: 2014-07-07 13:48 UTC by Igor Pashev
Modified: 2014-07-21 17:06 UTC (History)
4 users (show)

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


Description Igor Pashev 2014-07-07 13:48:08 UTC
ActiveUsers page does not work with Postgres (includes/specials/SpecialActiveusers.php):

Jul 07 13:15:21 xxx postgres[1234]: ERROR:  non-integer constant in ORDER BY at character 361             
Jul 07 13:15:21 xxx postgres[1234]: STATEMENT:  SELECT  rc_user_text,MAX(rc_timestamp) AS lastedittime  FROM "recentchanges"   WHERE (rc_user > 0) AND (rc_type != '5') AND (rc_log_type IS NULL OR rc_log_type != 'newusers') AND (rc_timestamp >= '2014-06-07 13:15:21 GMT') AND (rc_timestamp <= '2014-07-07 13:15:21 GMT')  GROUP BY rc_user_text ORDER BY NULL

This bug is introduced by
Comment 1 Jeff Janes 2014-07-08 19:23:56 UTC
Reproduced by simply going to http://localhost/wiki/index.php/Special:ActiveUsers

The "ORDER BY NULL" optimization seems to be MySQL peculiarity.

includes/specials/SpecialActiveusers.php: 'ORDER BY' => 'NULL' // avoid filesort

I can hack includes/db/DatabasePostgres.php selectSQLText to specifically delete that clause, but that is the correct to approach the problem?

Doing so doesn't make Special:ActiveUsers work again under PostgreSQL, but it does get further before hitting a different error.
Comment 2 Kevin Israel (PleaseStand) 2014-07-08 21:23:29 UTC
Jeff, is this fixed by ?
Comment 3 Gerrit Notification Bot 2014-07-08 21:43:21 UTC
Change 144824 had a related patch set uploaded by Jjanes:
Comment 4 Jeff Janes 2014-07-16 20:56:07 UTC

Yes, fixes this bug in 1.24.  I put the wrong bug number into the commit message, but since it got merged already I have no idea how to fix it now.  The pages for gerrit don't seem to cover the situation of amending a commit messge that has already been merged.
Comment 5 Andre Klapper 2014-07-21 10:46:09 UTC
Fixed by ; closing as FIXED.

Should there be a request to backport to 1.23.x tarballs? If so, feel free to set the backport flag in this ticket.
Comment 6 Jesús Martínez Novo (Ciencia Al Poder) 2014-07-21 11:04:45 UTC
Gerrit change #144824 is the backport to REL1_23, so I'm setting the appropriate flag
Comment 7 Gerrit Notification Bot 2014-07-21 15:24:05 UTC
Change 144824 merged by jenkins-bot:

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