Searching Quicksearch using the minus sign operator doesn't work

RESOLVED FIXED in Bugzilla 3.6

Status

()

--
major
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: mkanat, Assigned: mkanat)

Tracking

({regression})

3.5.3
Bugzilla 3.6
regression
Bug Flags:
approval +
approval3.6 +
blocking3.6 +

Details

Attachments

(1 attachment, 1 obsolete attachment)

v2
5.27 KB, patch
LpSolit
: review+
Details | Diff | Splinter Review
(Assignee)

Description

9 years ago
As of 3.6, you can't search for -6 in Quicksearch, it throws: Specified comparison type not supported.
Flags: blocking3.6+
(Assignee)

Updated

9 years ago
Target Milestone: --- → Bugzilla 3.6
(Assignee)

Comment 1

9 years ago
  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.
(Assignee)

Comment 2

9 years ago
Created attachment 434918 [details] [diff] [review]
v1

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

Updated

9 years ago
Attachment #434918 - Flags: review?(LpSolit) → review-

Comment 3

9 years ago
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.
(Assignee)

Updated

9 years ago
Attachment #434918 - Flags: review- → review?(LpSolit)
(Assignee)

Comment 4

9 years ago
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.

Comment 5

9 years ago
(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.

Comment 7

9 years ago
(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.
(Assignee)

Comment 8

9 years ago
  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.
(Assignee)

Comment 9

9 years ago
Created attachment 435499 [details] [diff] [review]
v2

This fixes it.
Attachment #434918 - Attachment is obsolete: true
Attachment #435499 - Flags: review?(LpSolit)
Attachment #434918 - Flags: review?(LpSolit)

Comment 10

9 years ago
Comment on attachment 435499 [details] [diff] [review]
v2

Seems to work fine, now. r=LpSolit
Attachment #435499 - Flags: review?(LpSolit) → review+

Updated

9 years ago
Flags: approval3.6+
Flags: approval+
(Assignee)

Comment 11

9 years ago
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
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.