Open Bug 704842 Opened 13 years ago Updated 8 years ago

Querying for bugs where the reporter is the single commenter no longer works

Categories

(Bugzilla :: Query/Bug List, defect)

4.1.3
defect
Not set
normal

Tracking

()

People

(Reporter: LpSolit, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(1 file)

In 4.0, you can use boolean charts to get all bugs where only the reporter commented in the bug:

NOT  "Commenter"  "is not equal to"  "%reporter%"

In 4.2 and trunk, this no longer works.

The difference in the SQL query is:

4.0: AND NOT ((`longdescs_0`.`who` IS NOT NULL))
4.2: AND NOT (`commenter_1`.`bug_id` IS NULL)


As this query is used to track bugs which didn't get traction (no other commenters besides the reporter), this is a pretty severe regression for triagers.
Flags: blocking4.2+
Hmm, I'm having hard time understanding how it no longer work. Looks like a "NOT commenter notequals %reporter%" search generates following SQL (only relevant parts) on 4.0:

  SELECT 1 FROM bugs LEFT JOIN longdescs AS longdescs_0 ON (longdescs_0.bug_id = bugs.bug_id AND longdescs_0.isprivate < 1 AND longdescs_0.who IN(SELECT userid FROM profiles WHERE profiles.userid != bugs.reporter)) WHERE NOT((longdescs_0.who IS NOT NULL))

and on 4.2:

  SELECT 1 FROM bugs INNER JOIN longdescs AS commenter_1 ON bugs.bug_id = commenter_1.bug_id AND commenter_1.who = bugs.reporter WHERE NOT( commenter_1.bug_id IS NULL )

Which part of that SQL is incorrect?
(In reply to Teemu Mannermaa (:wicked) from comment #1)
>   SELECT 1 FROM bugs INNER JOIN longdescs AS commenter_1 ON bugs.bug_id =
> commenter_1.bug_id AND commenter_1.who = bugs.reporter WHERE NOT(
> commenter_1.bug_id IS NULL )
> 
> Which part of that SQL is incorrect?

As all bugs have a description, commenter_1.who = bugs.reporter will match for all bugs. The correct SQL query is:

SELECT bugs.bug_id FROM bugs LEFT JOIN longdescs AS ld ON ld.bug_id = bugs.bug_id AND ld.who != bugs.reporter WHERE ld.bug_id IS NULL.
Did you try just "Commenter is not equal to reporter"? Custom Search works considerably more logically than the old Boolean Charts did.
Oh wait, you want bugs where the *only* commenter is the reporter.
I should probably add xt tests for this; that will help me understand what's going on better and look for a fix.
We decided it wasn't a blocker for 4.2 final, but still good to fix for 4.2.x.
Flags: blocking4.2+ → blocking4.2-
As far as I can tell, the code in _user_nonchanged() in Search.pm is wrong (this is the code which generates this part of the query).
Attached patch WIP, v0.1Splinter Review
This patch fixes the problem described in this bug, but now 120 xt tests fail complaining that when using notequals and other not* operators, they do not find bugs with no attachments, flags or CC members. IMO, this doesn't make sense. If I'm looking for bugs where the attachment author is not foo@bar.com, I only care about bugs where there is an attachment and this attachment author is not that guy. Also returning bugs with no attachments is IMO not what we want here. This is rather the job of NOT(attachment author is foo@bar.com).
To make things clear: "attacher is not foo" means that there is an attacher, but this attacher is not foo. This doesn't mean "there is no attacher or this attacher is not foo".
Blocks: 743883
(In reply to Frédéric Buclin from comment #9)
> To make things clear: "attacher is not foo" means that there is an attacher,
> but this attacher is not foo. This doesn't mean "there is no attacher or
> this attacher is not foo".

I filed a separate bug about this problematic, see bug 743883.
Bugzilla 4.2 is now restricted to security fixes only.
Target Milestone: Bugzilla 4.2 → ---
Thanks for marking my duplicate, anyway, may I ask about progress of the bug? It has been untouched for more than 3 years now.

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

Attachment

General

Created:
Updated:
Size: