Last modified: 2012-09-29 20:20:44 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 T28274, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26274 - Database layer should allow arrays for ORDER BY, GROUP BY, HAVING
Database layer should allow arrays for ORDER BY, GROUP BY, HAVING
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.17.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-12-07 13:35 UTC by Roan Kattouw
Modified: 2012-09-29 20:20 UTC (History)
4 users (show)

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


Attachments
GROUP BY/ORDER BY array() support (848 bytes, patch)
2010-12-07 13:59 UTC, Chad H.
Details

Description Roan Kattouw 2010-12-07 13:35:09 UTC
'ORDER BY' => 'foo, bar' works but 'ORDER BY' => array( 'foo', 'bar' ) doesn't. Same for GROUP BY. We also don't have nice array-based condition building for HAVING like we do for WHERE.
Comment 1 Chad H. 2010-12-07 13:59:59 UTC
Created attachment 7890 [details]
GROUP BY/ORDER BY array() support

For GROUP and ORDER BY, would something as simple as this work?
Comment 2 Roan Kattouw 2010-12-07 14:04:43 UTC
(In reply to comment #1)
> Created attachment 7890 [details]
> GROUP BY/ORDER BY array() support
> 
> For GROUP and ORDER BY, would something as simple as this work?
I think so
Comment 3 Sam Reed (reedy) 2011-02-22 23:53:23 UTC
Comment on attachment 7890 [details]
GROUP BY/ORDER BY array() support

r81272 applied this patch.
Comment 4 Sam Reed (reedy) 2011-02-22 23:57:45 UTC
"The SQL standard requires that HAVING must reference only columns in the GROUP BY clause or columns used in aggregate functions. However, MySQL supports an extension to this behavior, and permits HAVING to refer to columns in the SELECT list and columns in outer subqueries as well."

Our HAVING doesn't garuntee that ;)

Also roan, are you just meaning doing the HAVING more nicely, allowing things not having to put literal text to get it to work, and doing stuff like 'HAVING' => array( 'blah' => 2 ) etc?
Comment 5 p858snake 2011-04-30 00:09:44 UTC
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Comment 6 Sumana Harihareswara 2011-11-09 03:38:28 UTC
removed patch keyword - no patch attached anymore
Comment 7 db [inactive,noenotif] 2012-09-29 20:20:44 UTC
Already fixed

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


Navigation
Links