Bug 449934 - Mysql query fails when using Boolean Charts
Mysql query fails when using Boolean Charts
Product: Bugzilla
Classification: Community
Component: Query/Bug List (Show other bugs)
All Linux
medium Severity medium (vote)
: ---
: ---
Assigned To: PnT DevOps Devs
Depends On:
  Show dependency treegraph
Reported: 2008-06-04 07:18 EDT by Chris Ward
Modified: 2013-06-23 22:25 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-09-17 04:58:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Chris Ward 2008-06-04 07:18:22 EDT
Description of problem:
Bugzilla fails with the following error message when query contains boolean
chart using AND or OR queries. For example, I searched using :

'Flag' 'contains the string' 'pm_ack+' OR
'Flag' 'contains the string' 'dev_ack+'

and i also tried 

'Flag' 'contains the string' 'pm_ack+' 
'Flag' 'contains the string' 'dev_ack+'

Both fail. See below for exact http query.

Software error:

DBD::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,
map_assigned_to.login_name, map_reporter.login_name, bugs.bug_status,
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 = 215842 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.product_id IN (131)) AND (bugs.bug_status IN
AND ((POSITION('pm_ack+' IN LOWER(CONCAT(flagtypes_0.name,flags_0.status))) !=
0) AND (POSITION('dev_ack+' IN LOWER(CONCAT(flagtypes_0.name,flags_0.status)))
!= 0)) AND ((bug_group_map.group_id IS NULL)  OR bug_group_map.group_id IN
 OR (bugs.reporter_accessible = 1 AND bugs.reporter = 215842)  OR
(bugs.cclist_accessible = 1 AND cc.who IS NOT NULL)  OR (bugs.assigned_to =
215842)  OR (bugs.qa_contact = 215842) ) GROUP BY bugs.bug_id,
ORDER BY bugs.bug_status,bugs.bug_id"] 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 673

Search query used

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

How reproducible:
always, use the http query provided above.

Additional info:
Comment 1 Chris Ward 2008-06-04 07:48:10 EDT
Well, I imagine this is actually a dup, so please dup it if it is. :-)

I've found the work-around, which is to use separate boolean charts, and not use
AND/ORs when searching for flag combinations.

Suggested fix would be to at least catch these situations and report to the user
that the combination confuses Bugzilla's 'little' head and that they should try
to use multiple boolean charts instead. The exception should be caught and
handled more gracefully.
Comment 2 David Lawrence 2008-09-16 12:56:20 EDT
Red Hat Bugzilla is now using version 3.2 of the Bugzilla codebase and therefore this bug will need to be re-verified against the new release. With the updated code this bug may no longer be relevant or may have been fixed in the new code.
Updating bug version to 3.2.

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