Bug 437969 - Search doesn't work with new bugzilla instance
Summary: Search doesn't work with new bugzilla instance
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Bugzilla General (Show other bugs)
(Show other bugs)
Version: 3.2
Hardware: All Linux
low
low vote
Target Milestone: ---
Assignee: Tony Fu
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: RHBZ30UpgradeTracker
TreeView+ depends on / blocked
 
Reported: 2008-03-18 14:07 UTC by Ray Strode [halfline]
Modified: 2008-05-28 03:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-28 03:49:06 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Ray Strode [halfline] 2008-03-18 14:07:56 UTC
I just decided to give the new bugzilla a spin. I clicked "Search" and then in
the search field typed

rstrode gdm smart cards

or something like that and then I got a sql error:

Software error:

DBD::mysql::st execute failed: Unknown column 'user_group_map.group_id' in
'where clause' [for Statement "SELECT bugs.bug_id, bugs.bug_severity,
bugs.priority, bugs.bug_status, bugs.resolution, map_products.name,
bugs.bug_severity, bugs.priority, bugs.op_sys, map_assigned_to.login_name,
bugs.bug_status, bugs.resolution, bugs.short_desc,
(SUM(MATCH(longdescs_.thetext) AGAINST('rstrode gdm smart cards' )) + CASE WHEN
bugs.short_desc LIKE '%rstrode%' THEN 7 ELSE 0 END + CASE WHEN bugs.short_desc
LIKE '%gdm%' THEN 7 ELSE 0 END + CASE WHEN bugs.short_desc LIKE '%smart%' THEN 7
ELSE 0 END + CASE WHEN bugs.short_desc LIKE '%cards%' THEN 7 ELSE 0 END) AS
relevance FROM bugs  INNER JOIN profiles AS map_assigned_to ON (bugs.assigned_to
= map_assigned_to.userid) INNER JOIN products AS map_products ON
(bugs.product_id = map_products.id) LEFT JOIN longdescs AS longdescs_ ON
(bugs.bug_id = longdescs_.bug_id AND longdescs_.isprivate < 1) LEFT JOIN
bug_group_map  ON bug_group_map.bug_id = bugs.bug_id  WHERE (( bugs.bug_status
IN
('NEW','ASSIGNED','NEEDINFO','MODIFIED','ON_DEV','ON_QA','VERIFIED','FAILS_QA','RELEASE_PENDING','POST')
) AND (MATCH(longdescs_.thetext) AGAINST('rstrode gdm smart cards' ) > 0 OR
(bugs.short_desc LIKE '%rstrode%' OR bugs.short_desc LIKE '%gdm%' OR
bugs.short_desc LIKE '%smart%' OR bugs.short_desc LIKE '%cards%'))) AND
bugs.creation_ts IS NOT NULL AND (((user_group_map.group_id IS NOT NULL) OR
(bug_group_map.bug_id IS NULL))) GROUP BY bugs.bug_id ORDER BY relevance desc
LIMIT 200"] at /var/www/html/bugzilla/buglist.cgi line 940

For help, please send mail to the webmaster (sysadmin-engops@redhat.com), giving
this error message and the time and date of the error.

Comment 1 David Lawrence 2008-03-18 14:35:48 UTC
I was able to recreate this when not being logged in but it does work if you are
logged in. Please log in if you want to continue to test the new instance. We
will try to get this error fixed when users are not logged in.

Tony, can you take a look at this? It is related to the OR group changes made in
Bugzilla/Search.pm where it is checking for (user_group_map.group_id IS NULL)
but  user_group_map is not included in the table joins when a user is not logged
in. 

Thanks for the report
Dave

Comment 4 Tony Fu 2008-03-26 06:49:44 UTC
Created attachment 299103 [details]
Seach without user login

Comment 7 Tony Fu 2008-03-31 06:01:17 UTC
(In reply to comment #6)
> Created an attachment (id=299382) [edit]
> Patch to Search.pm implementing OR style group checking
> 

Thanks Dave.

The patch looks good.


Tony

Comment 8 Kevin Baker 2008-03-31 15:47:17 UTC
Tony,

did you test the patch to make sure it works in all the situations? 
non-logged-in user, logged-in-user, in/out of groups?

Comment 9 Tony Fu 2008-04-01 06:21:18 UTC
(In reply to comment #8)
> Tony,
> 
> did you test the patch to make sure it works in all the situations? 
> non-logged-in user, logged-in-user, in/out of groups?

I have tested this patch against a bugzilla installed on my system in all
situations, although the bugzilla system on my system only includes a few users,
products and groups data.

Tony

Comment 10 David Lawrence 2008-04-01 14:45:59 UTC
Thanks Tony

Comment 11 Kevin Baker 2008-04-15 02:52:44 UTC
Going into Milestone 3.


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