Open
Bug 253594
Opened 22 years ago
Updated 2 years ago
keyword bug counts are not accurate
Categories
(Bugzilla :: Bugzilla-General, defect, P5)
Tracking
()
NEW
People
(Reporter: kniht, Unassigned)
References
Details
Attachments
(1 file, 1 obsolete file)
|
2.83 KB,
patch
|
glob
:
review+
justdave
:
review-
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 Galeon/1.3.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030630 Galeon/1.3.8
The bug counts listed on the describekeywords page for each keyword don't match
the total shown in the buglist if you follow the bugcount link. It appears to
show the real total count of bugs using that keyword, but if you don't have
access to all of those bugs then the total won't match the buglist total.
Reproducible: Always
Steps to Reproduce:
1.add a keyword to a restricted bug
2.look at the describekeywords.cgi page from an account that doesn't have access
to all bugs with keywords
3.
Actual Results:
bugcount column shows total bugs using a keyword including bugs you don't have
access to
Expected Results:
only show the bug count total including the bugs the user has access to
Comment 1•22 years ago
|
||
This needs the customary criteria added to its query
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking2.18?
Target Milestone: --- → Bugzilla 2.18
Version: unspecified → 2.18
Comment 2•22 years ago
|
||
This has had a rudimentary test. Please try it and confirm that it returns the
right number.
Updated•22 years ago
|
Attachment #154712 -
Flags: review?
Attachment #154712 -
Flags: review? → review+
Comment 4•22 years ago
|
||
The old code did a single SQL query, getting the bug counts almost "for free".
The code in the patch appears to perform a separate query for each individual
keyword, which seems a HUGE performance hit for a feature that the user may not
be interested in. It looks like the template used by bugzilla.mozilla.org does
not even show the bug counts, so these extra queries would be completely wasted.
Also, consider the equivalent operation on "editkeywords.cgi"... it should
presumably have consistent bug counts to describekeywords.cgi, and it is at
least in principle possible for someone to have editkeywords privilege without
having access to all security and/or product groups... messages such as the
following could be confusing or misleading:
There are 0 bugs which have this keyword set. Are you sure you want to delete...
Comment 5•21 years ago
|
||
Comment on attachment 154712 [details] [diff] [review]
patch uses bug visibility logic
OK, I like the idea of still pulling it in the same query. So I experimented
with the SQL, and ran some tests using b.m.o's data and a user who was not a
member of the security group.
Here's a query that will pull the whole thing in one shot, and it doesn't even
take very long to run. :)
SELECT keyworddefs.name,
keyworddefs.description,
COUNT(keywords.bug_id)
FROM keyworddefs
LEFT JOIN keywords ON keyworddefs.id = keywords.keywordid
INNER JOIN bugs ON keywords.bug_id = bugs.bug_id
LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id
AND bug_group_map.group_id NOT IN ($grouplist)
LEFT JOIN cc ON bugs.bug_id = cc.bug_id AND cc.who = $uid
WHERE (bug_group_map.group_id IS NULL)
OR (bugs.assigned_to = $uid)
OR ( (bugs.reporter = $uid)
AND (bugs.reporter_accessible = 1) )
OR ( (cc.who IS NOT NULL)
AND (bugs.cclist_accessible = 1) )
OR (bugs.qa_contact = $uidqa)
GROUP BY keyworddefs.id
ORDER BY keyworddefs.name
163 rows in set (5.09 sec)
Spot checks on a couple keywords that commonly show up on security bugs shows
that the results are accurate, too.
Attachment #154712 -
Flags: review-
Comment 6•21 years ago
|
||
Oops, that misses keywords that aren't on any bugs. Try this one instead:
SELECT keyworddefs.name,
keyworddefs.description,
COUNT(keywords.bug_id)
FROM keyworddefs
LEFT JOIN keywords ON keyworddefs.id = keywords.keywordid
LEFT JOIN bugs ON keywords.bug_id = bugs.bug_id
LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id
AND bug_group_map.group_id NOT IN ($grouplist)
LEFT JOIN cc ON bugs.bug_id = cc.bug_id AND cc.who = $uid
WHERE (bug_group_map.group_id IS NULL)
OR (bugs.assigned_to = $uid)
OR ( (bugs.reporter = $uid)
AND (bugs.reporter_accessible = 1) )
OR ( (cc.who IS NOT NULL)
AND (bugs.cclist_accessible = 1) )
OR (bugs.qa_contact = $uidqa)
GROUP BY keyworddefs.id
ORDER BY keyworddefs.name
;
177 rows in set (5.64 sec)
Comment 7•21 years ago
|
||
I'll take this for 2.18 if someone finishes it up, but I won't block the release
on it.
Flags: blocking2.18? → blocking2.18-
Comment 8•21 years ago
|
||
Reassigning bugs that I'm not actively working on to the default component owner
in order to try to make some sanity out of my personal buglist. This doesn't
mean the bug isn't being dealt with, just that I'm not the one doing it. If you
are dealing with this bug, please assign it to yourself.
Assignee: justdave → general
QA Contact: mattyt-bugzilla → default-qa
Comment 9•21 years ago
|
||
OK, I don't think this bug is significant enough for a branch checkin, and I
don't think that we'll get to it before we release 2.20.
Severity: normal → minor
Target Milestone: Bugzilla 2.18 → Bugzilla 2.22
Updated•20 years ago
|
Target Milestone: Bugzilla 2.22 → ---
Updated•17 years ago
|
Priority: -- → P5
Updated•2 years ago
|
Attachment #9387088 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•