Bug 524825

Summary: remove duplicated code between Bugzilla/Search.pm and the extension buglist-columns
Product: [Community] Bugzilla Reporter: Noura El hawary <nelhawar>
Component: Query/Bug ListAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.4   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-10-26 12:33:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 514793    

Description Noura El hawary 2009-09-22 11:40:55 UTC
the extension extensions/redhat_fields/code/buglist-columns.pl is new extension used in 3.4 code that has similar code in Bugzilla/Search.pm as the following:
        # REDHAT EXTENSION START 406371 481660
        dependson           => { name => $dbh->sql_dependson_list() . " AS dependson",
                                 title => "Depends On" },
        blockedby           => { name => $dbh->sql_blockedby_list() . " AS blockedby",
                                 title => "Blocked By" },
        flags               => { name => $dbh->sql_flag_list() . " AS flags",
                                 title => "Flags" },
        alias               => { name => $dbh->sql_alias_list() . " AS alias",
                                 title => "Alias" },
        # REDHAT EXTENSION END 406371 481660


this is causing the sql list database functions to be called twice which produces invalid SQL queries and fails the search that includes the above columsn for example currently this will fail
buglist.cgi?quicksearch=%40xx45ft&columnlist=all

Comment 2 Noura El hawary 2009-10-07 13:12:45 UTC
This bug related to bug found in bz-web1 when trying to change columns of r a search to include the multi value columns as the following:

Software error:

DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS blockedby FROM bugs  INNER JOIN profiles AS map_assigned_to ON (bugs.assigned' at line 1 [for Statement "SELECT bugs.bug_id AS bug_id, bugs.bug_severity AS bug_severity, bugs.priority AS priority, bugs.bug_status AS bug_status, bugs.resolution AS resolution, map_products.name AS product, map_assigned_to.login_name AS assigned_to, bugs.short_desc AS short_desc, bugs.cf_pm_score AS cf_pm_score, bugs.cf_clone_of AS cf_clone_of, BlockedByList(bugs.bug_id) AS blockedby AS blockedby 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) AND (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  LEFT JOIN cc ON cc.bug_id = bugs.bug_id AND cc.who = 208811 WHERE (( bugs.bug_status IN ('NEW','ASSIGNED','MODIFIED','ON_DEV','ON_QA','VERIFIED','FAILS_QA','RELEASE_PENDING','POST') ) AND ( map_products.classification_id IN (1) ) AND ( bugs.component_id IN (14303) ) AND ( bugs.product_id IN (58) ) AND ( bugs.version IN ('2.1','3','4','5') )) AND bugs.creation_ts IS NOT NULL AND ((bug_group_map.group_id IS NULL) OR (bug_group_map.group_id IN (20,6,187,188,8,3,7,186,4,9,5,2,17,25,35,18,1,94,147,76,68,198,144,184,86,15,155,130,146,195,82,123,122,33,196,194,21,31,12,152,206,23,190,205,97,24,106,150,199,41,69,210,58,85,92,107,50,191,87,83,183,120,116,118,114,117,133,79,81,182,192,204,32,34,112,111,113,16,200,201,103,27,75,63,151,110,181,148,13,193,91,84,108,197,119,145,30,212,213,105,211,124,128,125,162,70,11,207,171,149,102,101,161,141,185,142,140,129,80,156,159,44,135,136,134,22,38,137,139,138,104,154,127,29,98,157,202,100,19,71,132,78,143,126,65,96,93,10,48,208,209,131,109,57,56,153,99,189,74,121,14,67,95))    OR (bugs.reporter_accessible = 1 AND bugs.reporter = 208811)     OR (bugs.cclist_accessible = 1 AND cc.who IS NOT NULL)     OR (bugs.assigned_to = 208811) OR (bugs.qa_contact = 208811) ) GROUP BY bugs.bug_id ORDER BY bug_status.sortkey,bug_status.value,priority.sortkey,priority.value,assigned_to,bug_id"] at /var/www/html/bugzilla/buglist.cgi line 976
	ModPerl::ROOT::Bugzilla::ModPerl::ResponseHandler::var_www_html_bugzilla_buglist_2ecgi::handler('Apache2::RequestRec=SCALAR(0x2b00874142e0)') called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm line 204
	eval {...} called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm line 204
	ModPerl::RegistryCooker::run('Bugzilla::ModPerl::ResponseHandler=HASH(0x2b00874143e0)') called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/ModPerl/RegistryCooker.pm line 170
	ModPerl::RegistryCooker::default_handler('Bugzilla::ModPerl::ResponseHandler=HASH(0x2b00874143e0)') called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/ModPerl/Registry.pm line 31
	ModPerl::Registry::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x2b00874142e0)') called at /var/www/html/bugzilla/mod_perl.pl line 105
	Bugzilla::ModPerl::ResponseHandler::handler('Bugzilla::ModPerl::ResponseHandler', 'Apache2::RequestRec=SCALAR(0x2b00874142e0)') called at -e line 0
	eval {...} called at -e line 0

Comment 3 Noura El hawary 2009-10-26 12:33:19 UTC
This bug has been fixed with Dave's latest patch to the Search code in bugzilla3.4, the error is no longer producible.