Doing 2 email searches fails when searching for CC list members

RESOLVED FIXED in Bugzilla 2.18

Status

()

P1
normal
RESOLVED FIXED
16 years ago
6 years ago

People

(Reporter: bryner, Assigned: bugreport)

Tracking

({regression})

2.17.1
Bugzilla 2.18
x86
Linux
regression
Bug Flags:
approval +

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

16 years ago
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
(Assignee)

Comment 2

16 years ago
Created attachment 107016 [details] [diff] [review]
Patch 

This is a bit of a hack, but this will keep CC joins from using the null
$chartid value over and over.
(Assignee)

Comment 3

16 years ago
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
(Assignee)

Updated

16 years ago
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-
(Assignee)

Comment 7

16 years ago
Created attachment 107102 [details] [diff] [review]
patch v2

OK, myk's items covered
Attachment #107016 - Attachment is obsolete: true
(Assignee)

Updated

16 years ago
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-
(Assignee)

Updated

16 years ago
Status: NEW → ASSIGNED
Flags: approval?
(Assignee)

Comment 9

16 years ago
Created attachment 107104 [details] [diff] [review]
v3
Attachment #107102 - Attachment is obsolete: true
Attachment #107104 - Flags: review+
Flags: approval? → approval+
(Assignee)

Comment 10

16 years ago

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
Last Resolved: 16 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.