buglist.cgi crashes for logged out users if the "Reporter" column is displayed

RESOLVED FIXED in Bugzilla 3.4

Status

()

Bugzilla
Query/Bug List
--
blocker
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: Frédéric Buclin, Assigned: Frédéric Buclin)

Tracking

({regression})

3.3.2
Bugzilla 3.4
regression
Bug Flags:
approval +
blocking3.4 +

Details

Attachments

(2 attachments)

772 bytes, patch
Max Kanat-Alexander
: review+
Details | Diff | Splinter Review
847 bytes, patch
Max Kanat-Alexander
: review+
Details | Diff | Splinter Review
(Assignee)

Description

10 years ago
On landfill, if the Reporter column is displayed while I'm logged out, buglist.cgi crashes:

http://landfill.bugzilla.org/bugzilla-tip-pg/buglist.cgi?quicksearch=%40myk

DBD::Pg::st execute failed: ERROR:  column "map_reporter.login_name" must appear in the GROUP BY clause or be used in an aggregate function
 [for Statement "SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status, bugs.resolution, SUBSTRING(map_assigned_to.login_name FROM 1 FOR POSITION('@' IN map_assigned_to.login_name) - 1), bugs.bug_status, bugs.resolution, map_products.name, bugs.short_desc, SUBSTRING(map_reporter.login_name FROM 1 FOR POSITION('@' IN map_reporter.login_name) - 1), map_assigned_to.login_name FROM bugs  INNER JOIN profiles AS map_assigned_to ON (bugs.assigned_to = map_assigned_to.userid) INNER JOIN profiles AS map_reporter ON (bugs.reporter = map_reporter.userid) INNER JOIN products AS map_products ON (bugs.product_id = map_products.id) LEFT JOIN bug_status ON (bug_status.value = bugs.bug_status) LEFT JOIN priority ON (priority.value = bugs.priority) LEFT JOIN bug_group_map  ON bug_group_map.bug_id = bugs.bug_id  WHERE (( bugs.bug_status IN ('REOPENED','NEW','ASSIGNED','UNCONFIRMED') )) AND ((bugs.assigned_to IN (SELECT userid FROM profiles WHERE POSITION(LOWER('myk') IN LOWER(profiles.login_name)) > 0))) AND bugs.creation_ts IS NOT NULL AND ((bug_group_map.group_id IS NULL)) GROUP BY bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status, bugs.resolution, map_products.name, bugs.short_desc, map_assigned_to.login_name, bug_status.sortkey, bug_status.value, priority.sortkey, priority.value ORDER BY bug_status.sortkey,bug_status.value,priority.sortkey,priority.value,map_assigned_to.login_name,bugs.bug_id"] at /var/www/html/bugzilla-tip-pg/buglist.cgi line 1077


On my test installation, the error message mentions "map_assigned_to.login_name". I guess one would get the same error message if the QA contact column was displayed.

Also, even if you don't display the Reporter column, you still get the following error message (appears only every other time):

"The custom sort order specified in your cookie contains an invalid column name map_assigned_to.login_name. The cookie has been cleared." This error is only displayed for logged out users. So I'm pretty sure that's a regression due to bug 219021.

Comment 1

10 years ago
Yeah, the GROUP BY parser probably isn't picking up the column correctly. I imagine this happens for any of the user columns.
(Assignee)

Comment 2

10 years ago
Created attachment 361341 [details] [diff] [review]
patch, v1

Please test this patch. I did only a brief test to make sure it fixes the problem for me on PostgreSQL. I will let xiaoou fix the regexp for Oracle.
Assignee: query-and-buglist → LpSolit
Status: NEW → ASSIGNED
Attachment #361341 - Flags: review?(mkanat)
(Assignee)

Updated

10 years ago
Attachment #361341 - Flags: review?(wicked)

Comment 3

10 years ago
Created attachment 361456 [details] [diff] [review]
Oracle patch

Yeah, because a SUBSTR is added in Bug 477745
Attachment #361456 - Flags: review?(mkanat)
(Assignee)

Updated

10 years ago
Flags: blocking3.4+

Comment 4

10 years ago
Comment on attachment 361341 [details] [diff] [review]
patch, v1

Okay, if you've tested it, this looks good to me
Attachment #361341 - Flags: review?(wicked)
Attachment #361341 - Flags: review?(mkanat)
Attachment #361341 - Flags: review+

Comment 5

10 years ago
Comment on attachment 361456 [details] [diff] [review]
Oracle patch

I sure hope you actually tested this, Xiaoou.
Attachment #361456 - Flags: review?(mkanat) → review+

Updated

10 years ago
Flags: approval3.4+
Flags: approval+
(Assignee)

Comment 6

10 years ago
Clearing the approval3.4+ flag as we didn't branch yet:

Checking in Bugzilla/DB.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB.pm,v  <--  DB.pm
new revision: 1.124; previous revision: 1.123
done
Checking in Bugzilla/DB/Oracle.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm,v  <--  Oracle.pm
new revision: 1.22; previous revision: 1.21
done
Status: ASSIGNED → RESOLVED
Last Resolved: 10 years ago
Flags: approval3.4+
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.