Closed Bug 180980 Opened 22 years ago Closed 22 years ago

Doing 2 email searches fails when searching for CC list members

Categories

(Bugzilla :: Query/Bug List, defect, P1)

2.17.1
x86
Linux
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: bryner, Assigned: bugreport)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Steps to reproduce:

Fill out both parts of the email search field as follows:

Search 1: Bug Reporter or CC list member is <user1>
Search 2: Bug Reporter or CC list member is <user2>

Submit the query.

Results:

Software error:

SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.rep_platform,
map_assigned_to.login_name, bugs.bug_status, bugs.resolution, bugs.short_desc
FROM bugs, profiles AS map_assigned_to LEFT JOIN cc cc_ ON bugs.bug_id =
cc_.bug_id AND cc_.who IN(4346) LEFT JOIN cc cc_ ON bugs.bug_id = cc_.bug_id AND
cc_.who IN(15991) LEFT JOIN bug_group_map  ON bug_group_map.bug_id = bugs.bug_id
 WHERE bugs.assigned_to = map_assigned_to.userid AND bugs.assigned_to =
map_assigned_to.userid AND bugs.assigned_to = map_assigned_to.userid AND
(bugs.bug_status IN ('NEW','ASSIGNED','REOPENED')) AND
((map_assigned_to.login_name IN ('tao@netscape.com')) OR (cc_.who IS NOT NULL))
AND ((map_assigned_to.login_name IN ('bryner@netscape.com')) OR (cc_.who IS NOT
NULL)) AND ((bug_group_map.group_id IS NULL)) GROUP BY bugs.bug_id ORDER BY
bugs.bug_id : Not unique table/alias: 'cc_' at globals.pl line 283.
Now that we pull the list emails stuff out, we need to do more than one table
join, using all three digits from the boolean bits fot the tbale identifier.

Bleh.
Keywords: regression
Attached patch Patch (obsolete) — Splinter Review
This is a bit of a hack, but this will keep CC joins from using the null
$chartid value over and over.
myk has this as a the last 2.17.1 blocker, so I'll fix it.
Assignee: endico → bugreport
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.18
Attachment #107016 - Flags: review?(myk)
I wonder if this ever worked.  On my test install of the last version of
Bugzilla, the query does, f.e. "(map_cc_.login_name = 'myk@mozilla.org') AND
(map_cc_.login_name = 'asa@mozilla.org')", which of course returns no results.
myk: Those two things in query.cgi are ANDed not OR'd.

However, it should still be possible to serach on them taht way - bryner's
search will return results.
Comment on attachment 107016 [details] [diff] [review]
Patch 

>Index: Bugzilla/Search.pm

>+             my $xtra;
>+             $xtra = $chartid;
>+             if ($chartid eq "") {
>+                 $xtra = "A$extraid";
>+                 $extraid++;
>+             }

The "chartid" variable is declared without being defined on line 289, so
comparing it to the empty string could fail in some cases.  It would be better
to compare it for boolean trueness (i.e. "if ($chartid) {")

Nit: "extra" and "xtra" could be more clearly named, although I'm not sure what
the best name would be.  The only thing I can think of is "occurrence", but
that's too long and cumbersome.

Nit: "A" would be clearer and more future-proof as "cc".

Fix the first problem and (optionally) fix the nits, and I'll grant it review.
Attachment #107016 - Flags: review?(myk) → review-
Attached patch patch v2 (obsolete) — Splinter Review
OK, myk's items covered
Attachment #107016 - Attachment is obsolete: true
Attachment #107102 - Flags: review?(myk)
Comment on attachment 107102 [details] [diff] [review]
patch v2

>Index: Bugzilla/Search.pm

>+             if ($chartid) {

Hmm, sorry, it turns out I was wrong in advising you to change this
conditional.  It really should be '$chartid eq ""'.

Fix that, and r=myk
Attachment #107102 - Flags: review?(myk) → review-
Status: NEW → ASSIGNED
Flags: approval?
Attached patch v3Splinter Review
Attachment #107102 - Attachment is obsolete: true
Attachment #107104 - Flags: review+
Flags: approval? → approval+

Checking in Bugzilla/Search.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v  <--  Search.pm
new revision: 1.37; previous revision: 1.36
done
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 191338 has been marked as a duplicate of this bug. ***
*** Bug 217426 has been marked as a duplicate of this bug. ***
*** Bug 217071 has been marked as a duplicate of this bug. ***
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: