Closed Bug 554986 Opened 14 years ago Closed 14 years ago

Searching Quicksearch using the minus sign operator doesn't work

Categories

(Bugzilla :: Query/Bug List, defect)

3.5.3
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 3.6

People

(Reporter: mkanat, Assigned: mkanat)

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

As of 3.6, you can't search for -6 in Quicksearch, it throws: Specified comparison type not supported.
Flags: blocking3.6+
Target Milestone: --- → Bugzilla 3.6
  Okay, this is because there's no negation for "matches". (There's no notmatches.) Also, you can't just search for "'-6' IN BOOLEAN MODE" using the MySQL fulltext engine--it returns 0 results (this is documented). So we have to add a notmatches type.
Attached patch v1 (obsolete) — Splinter Review
Okay, this adds a "notmatches" search type, so that using negation on bare words in Quicksearch will work. In order for "Edit Search" to work, I also had to add it to the query page.
Assignee: query-and-buglist → mkanat
Status: NEW → ASSIGNED
Attachment #434918 - Flags: review?(LpSolit)
Keywords: regression
Attachment #434918 - Flags: review?(LpSolit) → review-
Comment on attachment 434918 [details] [diff] [review]
v1

With your patch applied, the boolean chart "commenter matches foo" crashes with:

Can't use string ("") as a subroutine ref while "strict refs" in use at Bugzilla/Search.pm line 1516.
 at Bugzilla/Search.pm line 1516
	Bugzilla::Search::_commenter('Bugzilla::Search=HASH(0xa689740)', 'sequence', 'SCALAR(0xa2baea8)', 'ff', 'SCALAR(0xa2baef8)', 'wherepart', 'ARRAY(0xa2a5b50)', 'supptables', 'ARRAY(0xa2a5b30)', ...) called at Bugzilla/Search.pm line 844
	Bugzilla::Search::init('Bugzilla::Search=HASH(0xa689740)') called at Bugzilla/Search.pm line 198
	Bugzilla::Search::new('Bugzilla::Search', 'fields', 'ARRAY(0xa399b20)', 'params', 'Bugzilla::CGI=HASH(0xa4e6408)', 'order', 'ARRAY(0xa3ae680)') called at /var/www/html/bugzilla/buglist.cgi line 829

instead of throwing:

The "content" field can only be used with "matches" search and the "matches" search can only be used with the "content" field.

as it does without your patch.

Otherwise looks good and seems to work correctly.
Attachment #434918 - Flags: review- → review?(LpSolit)
Comment on attachment 434918 [details] [diff] [review]
v1

(In reply to comment #3)
> Can't use string ("") as a subroutine ref while "strict refs" in use at
> Bugzilla/Search.pm line 1516.

  Okay, I just checked, and on trunk (but not on 3.6), this is happening without my patch. So it would be a separate bug.
(In reply to comment #4)
>   Okay, I just checked, and on trunk (but not on 3.6), this is happening
> without my patch. So it would be a separate bug.

I tested with 3.7, and the crash doesn't happen without your patch.
(In reply to comment #6)
That's not the query I'm talking about. I'm talking about:

https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?field0-0-0=assigned_to&type0-0-0=matches&value0-0-0=sasdf

notmatches is a URL hack, while this one is a perfectly valid one, which you can get from the UI.
  Oh, okay. Will look into it. Still, from the code I can see in Search.pm, the bug *should* already be happening. Not quite sure what's up.
Attached patch v2Splinter Review
This fixes it.
Attachment #434918 - Attachment is obsolete: true
Attachment #435499 - Flags: review?(LpSolit)
Attachment #434918 - Flags: review?(LpSolit)
Comment on attachment 435499 [details] [diff] [review]
v2

Seems to work fine, now. r=LpSolit
Attachment #435499 - Flags: review?(LpSolit) → review+
Flags: approval3.6+
Flags: approval+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/                       
modified Bugzilla/Search.pm
modified Bugzilla/Search/Quicksearch.pm
modified template/en/default/global/code-error.html.tmpl
modified template/en/default/global/field-descs.none.tmpl
modified template/en/default/list/list.html.tmpl
modified template/en/default/search/boolean-charts.html.tmpl
Committed revision 7100.

Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/3.6/                         
modified Bugzilla/Search.pm
modified Bugzilla/Search/Quicksearch.pm
modified template/en/default/global/code-error.html.tmpl
modified template/en/default/global/field-descs.none.tmpl
modified template/en/default/list/list.html.tmpl
modified template/en/default/search/boolean-charts.html.tmpl
Committed revision 7059.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: