From: Byron Jones Date: Fri, 20 Feb 2015 05:35:01 +0000 (+0800) Subject: Bug 1088086: Possible duplicate search doesn't return any results if you input "a... X-Git-Tag: release-5.1.1~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720e7d4f84a0706cbb4e41c4df8ea29373a50c27;p=thirdparty%2Fbugzilla.git Bug 1088086: Possible duplicate search doesn't return any results if you input "a->b" (for any a/b) r=dylan,a=glob --- diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index ef983ce556..389cc6baa9 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -184,15 +184,19 @@ sub sql_fulltext_search { if ($text =~ /(?:^|\W)[+\-<>~"()]/ || $text =~ /[()"*](?:$|\W)/) { $mode = 'IN BOOLEAN MODE'; - # quote un-quoted compound words - my @words = quotewords('[\s()]+', 'delimiters', $text); - foreach my $word (@words) { - # match words that have non-word chars in the middle of them - if ($word =~ /\w\W+\w/ && $word !~ m/"/) { - $word = '"' . $word . '"'; + my @terms = split(quotemeta(FULLTEXT_OR), $text); + foreach my $term (@terms) { + # quote un-quoted compound words + my @words = quotewords('[\s()]+', 'delimiters', $term); + foreach my $word (@words) { + # match words that have non-word chars in the middle of them + if ($word =~ /\w\W+\w/ && $word !~ m/"/) { + $word = '"' . $word . '"'; + } } + $term = join('', @words); } - $text = join('', @words); + $text = join(FULLTEXT_OR, @terms); } # quote the text for use in the MATCH AGAINST expression