Closed Bug 552919 Opened 14 years ago Closed 14 years ago

Sort group_concat results so that they sort correctly for buglists

Categories

(Bugzilla :: Query/Bug List, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: mkanat, Assigned: mkanat)

Details

Attachments

(1 file)

Right now, sql_group_concat can return data like B,A,C or C,B,A or A,C,B, etc. It should always be consistent with how it sorts data, so that the whole string can be sorted on properly in buglist.cgi. (This is the same problem we had for Keywords, a while back, before we sorted them pre-display.)

  The idea is to add a third parameter to sql_group_concat that specifies a column name to order the results by. This works fine in MySQL--it accepts an ORDER BY argument to GROUP_CONCAT. For PostgreSQL, I'm not quite sure what I'll do yet; I'm going to have to investigate.

  Xiaoou--is there a way to support this for Oracle?
This should be supportable for MSSQL down the road.
Flags: blocking4.0+
Attached patch v1Splinter Review
Okay, this adds ordering to sql_group_concat for both MySQL and PostgreSQL, and makes it default.

Technically, it's optional--group_concat will still work as we expect without the ordering, but with the ordering, we're guaranteed that concat'ed values will always have the same order, which lets us sort on them properly in buglist.cgi.
Assignee: query-and-buglist → mkanat
Status: NEW → ASSIGNED
Attachment #456212 - Flags: review+
  Xiaoou: We'll need some implementation of this for Oracle or Oracle just won't have good sorting for multi-selects, keywords, and flags in buglist.cgi.
Granting myself review as Database module owner, because this really just touches database code, and then adjusts the calling syntax of that database code in a few places.
Flags: approval+
  Okay, I've checked in the patch. I'll still take a patch for Oracle on this bug from Xiaoou or anybody who wants to do it, though.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Search.pm
modified Bugzilla/DB/Mysql.pm
modified Bugzilla/DB/Oracle.pm
modified Bugzilla/DB/Pg.pm
modified Bugzilla/Install/DB.pm
Committed revision 7285.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: