Bug 383121 - Attempting to search for multiple flags breaks unique in query.
Attempting to search for multiple flags breaks unique in query.
Status: CLOSED NEXTRELEASE
Product: Bugzilla
Classification: Community
Component: Query/Bug List (Show other bugs)
2.18
All Linux
medium Severity medium (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-14 14:22 EST by Corey Welton
Modified: 2013-06-23 22:44 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-11-14 14:35:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Welton 2007-11-14 14:22:43 EST
Description of problem:
If user tries to do a query which contains multiple flags in the boolean, s/he
is returned a SQL error.

Version-Release number of selected component (if applicable):
2.18rh

How reproducible:
Every time.

Steps to Reproduce:
1.  Login to bz; go to advanced query page.
2.  Scroll down to "Advanced Searching Using Boolean Charts"
3.  Using the "And" button to open a second boolean field, use the following
queries:
* Flag  is equal to  pm_ack+
* Flag  is equal to  rhel-4.6+
4.  Submit query.
  
Actual results:
SQL error:

BD::mysql::st execute failed: Not unique table/alias: 'flags_0' [for Statement
"SELECT bugs.bug_id, bugs.bug_severity, bugs.priority, bugs.bug_status,
bugs.resolution, bugs.alias, bugs.bug_severity, bugs.priority,
bugs.rep_platform, map_assigned_to.login_name, map_reporter.login_name,
bugs.bug_status, bugs.resolution, bugs.short_desc FROM bugs LEFT JOIN
bug_group_map  ON bug_group_map.bug_id = bugs.bug_id  LEFT JOIN cc ON cc.bug_id
= bugs.bug_id AND cc.who = 197269 LEFT JOIN flags AS flags_0 ON bugs.bug_id =
flags_0.bug_id AND flags_0.is_active = 1 LEFT JOIN flagtypes AS flagtypes_0 ON
flags_0.type_id = flagtypes_0.id LEFT JOIN flags AS flags_0 ON bugs.bug_id =
flags_0.bug_id AND flags_0.is_active = 1 LEFT JOIN flagtypes AS flagtypes_0 ON
flags_0.type_id = flagtypes_0.id , profiles AS map_assigned_to, profiles AS
map_reporter WHERE bugs.assigned_to = map_assigned_to.userid AND bugs.reporter =
map_reporter.userid AND ((bugs.bug_status IN
('NEW','ASSIGNED','NEEDINFO','MODIFIED'))) AND
((CONCAT(flagtypes_0.name,flags_0.status) = 'pm_ack+') AND
(CONCAT(flagtypes_0.name,flags_0.status) = 'rhel-4.6+')) AND
((bug_group_map.group_id IS NULL)  OR bug_group_map.group_id IN
(81,134,106,149,75,68,148,138,144,140,12,79,76,67,41,171,127,58,122,35,133,7,62,126,93,17,146,72,11,50,84,39,10,33,107,22,4,119,78,14,123,145,108,139,44,124,150,121,85,92,91,15,80,21,142,61,155,83,74,147,94)
 OR (bugs.reporter_accessible = 1 AND bugs.reporter = 197269)  OR
(bugs.cclist_accessible = 1 AND cc.who IS NOT NULL)  OR (bugs.assigned_to =
197269)  OR (bugs.qa_contact = 197269) ) GROUP BY bugs.bug_id,
bugs.bug_id,bugs.bug_severity,bugs.priority,bugs.bug_status,bugs.resolution,bugs.alias,bugs.bug_severity,bugs.priority,bugs.rep_platform,map_assigned_to.login_name,map_reporter.login_name,bugs.bug_status,bugs.resolution,bugs.short_desc
ORDER BY bugs.bug_id asc"] at Bugzilla/DB.pm line 71
	Bugzilla::DB::SendSQL('SELECT bugs.bug_id, bugs.bug_severity, bugs.priority,
bugs.bu...') called at /var/www/html/bugzilla/buglist.cgi line 659


Expected results:
Preferably the ability to search for more than one flag at a time (subqueries,
etc.).  But I guess something other than sql barf would suffice for now.

Additional info:
* Searches for either one of these flags works fine.  It's when a user wants an
intersect of these two flags that we run into an error.
Comment 1 David Lawrence 2007-11-14 14:35:45 EST
Known issue with our current version of Bugzilla. To workaround this issue when
searching for multiple values of the same field type (in this case Flags) use the
"Add another boolean chart" button instead of "And". This should accomplish what
you want. This will be fixed in the upcoming upgrade to newer Bugzilla 3.0.

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