Page MenuHomePhabricator

Database layer should allow arrays for ORDER BY, GROUP BY, HAVING
Closed, ResolvedPublic

Description

'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.


Version: 1.17.x
Severity: enhancement

Details

Reference
bz26274

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:18 PM
bzimport set Reference to bz26274.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 7890
GROUP BY/ORDER BY array() support

For GROUP and ORDER BY, would something as simple as this work?

attachment dbobpatch ignored as obsolete

(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

attachment dbobpatch ignored as obsolete

Comment on attachment 7890
GROUP BY/ORDER BY array() support

r81272 applied this patch.

"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?

*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*

sumanah wrote:

removed patch keyword - no patch attached anymore