Bug 826829

Summary: Software error when doing anywords or allwords search that starts or ends with a space
Product: [Community] Bugzilla Reporter: Qin Guan <qguan>
Component: Query/Bug ListAssignee: Simon Green <sgreen>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2CC: ebaak, leiwang, sgreen
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 4.2.1-2 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-11 23:39:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
20120531-bugzilla-query-error.txt none

Description Qin Guan 2012-05-31 05:20:51 UTC
Description of problem:

Found this error when query bugs with space in front of the string in the comment of the detailed bug information.

Please stand by ...
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 ')

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

How reproducible:
100%

Steps to Reproduce:
1. Open the Advanced Search page
2. Select any Product and Component, such as 
 Product : Red Hat Enterprise Linux 5
 Component: kernel-xen
3. Input a string into the Comment Input box with a space in front of, like " vcpu" (without quotes), like below: 
 Detailed Bug Information 
 Comment:  contains all of the strings " vcpu"(without quotes)
  
Actual results:
Software error

Expected results:
No Software error

Additional info:

Comment 1 Qin Guan 2012-05-31 05:22:08 UTC
Created attachment 587939 [details]
20120531-bugzilla-query-error.txt

Comment 2 Simon Green 2012-05-31 06:31:20 UTC
Reason for hotfix: This one is going upstream, but I want to provide a patch for them too.

Comment 4 Simon Green 2012-05-31 13:03:10 UTC
Filed upstream at https://bugzilla.mozilla.org/show_bug.cgi?id=760075

Will be in our 4.2.1-2 release regardless.

  -- simon

Comment 5 Simon Green 2012-06-06 05:55:42 UTC
Upstream rejected our changes because it caused an unintended side effect. We will fix our code to match the change upstream too.

  -- simon

Comment 6 Simon Green 2012-06-11 23:39:38 UTC
The upstream change was approved for Bugzilla 4.2, so we will inherit it with the next release.

  -- simon