Closed Bug 418518 Opened 18 years ago Closed 18 years ago

Search links in editkeywords.cgi and describekeywords.cgi generate incorrect SQL queries

Categories

(Bugzilla :: Query/Bug List, defect)

3.1.3
defect
Not set
major

Tracking

()

VERIFIED FIXED
Bugzilla 3.2

People

(Reporter: vitaly.fedrushkov, Assigned: jjclark1982)

References

()

Details

(Keywords: regression, selenium)

Attachments

(1 file)

QUOTE Software error: DBD::mysql::st execute failed: Unknown column 'keywords_.keywordid' 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 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 bug_status ON (bug_status.value = bugs.bug_status) LEFT JOIN priority ON (priority.value = bugs.priority) LEFT JOIN bug_group_map ON bug_group_map.bug_id = bugs.bug_id AND bug_group_map.group_id NOT IN (13,4,1,10,11,6,2,8,12,5,3,7,9) LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = 1 WHERE (((keywords_.keywordid = 2))) AND bugs.creation_ts IS NOT NULL AND ((bug_group_map.group_id IS NULL) OR (bugs.reporter_accessible = 1 AND bugs.reporter = 1) OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL) OR (bugs.assigned_to = 1) OR (bugs.qa_contact = 1) ) GROUP BY bugs.bug_id ORDER BY bug_status.sortkey,bug_status.value,priority.sortkey,priority.value,map_assigned_to.login_name,bugs.bug_id"] at C:/bz/tip/buglist.cgi line 1015 UNQUOTE Steps to reproduce: 1. Use empty Bugzilla database. 2. Create a keyword. 3. Follow the '0' (i.e. 'Count') link at editkeywords.cgi Looks like we have to rebuild keyword cache more often than recommended by administration UI notes.
sanitycheck.cgi?rebuildkeywordcache=1 didn't help either.
OS: Windows XP → All
Hardware: PC → All
Yes, I can reproduce on tip. The query being executed on tip has a missing LEFT JOIN keywords AS keywords_ ON (keywords_.bug_id = bugs.bug_id) which exists in 3.0.4. I don't know if this part of the query is still required as is, but what is sure is that keywords_.keywordid is used in the WHERE part of the query without the keywords_ table being defined in the FROM part. Bugzilla 3.0.4 is not affected, but I have no clue what regressed this. Maybe jjclark's big patch about removing anonymous subroutines? Note that QuickSearch is not affected as it uses a different query, see buglist.cgi?quicksearch=kw:helpwanted&debug=1. I pasted in the URL field the URL used by editkeywords.cgi and which crashes on tip. Marking this bug as a blocker as it makes query links in editkeywords.cgi unusable.
Severity: minor → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: blocking3.2+
Keywords: regression
Target Milestone: --- → Bugzilla 3.2
Using keywords in boolean charts or in the advanced search form itself doesn't crash as none of them use keywords_.keywordid. They both use bugs.keywords instead. Maybe something has not been correctly cleaned up in Search.pm (or in buglist.cgi)?
Summary: Keyword search fails right after creation → Search links in editkeywords.cgi generate incorrect SQL queries
describekeywords.cgi is affected too as it uses the same queries as editkeywords.cgi.
Summary: Search links in editkeywords.cgi generate incorrect SQL queries → Search links in editkeywords.cgi and describekeywords.cgi generate incorrect SQL queries
Attached patch v1Splinter Review
This regression was caused by an omitted argument to the keyword search function in my big patch about removing anonymous subroutines.
Assignee: query-and-buglist → jjclark1982
Status: NEW → ASSIGNED
Attachment #304637 - Flags: review?(LpSolit)
Comment on attachment 304637 [details] [diff] [review] v1 Looks good to me.
Attachment #304637 - Flags: review?(LpSolit) → review+
Flags: approval+
Checking in Bugzilla/Search.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v <-- Search.pm new revision: 1.155; previous revision: 1.154 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
This indeed fixes the crash. Thanks.
Status: RESOLVED → VERIFIED
Flags: testcase+
Keywords: selenium
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: