]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1088086: Possible duplicate search doesn't return any results if you input "a...
authorByron Jones <glob@mozilla.com>
Fri, 20 Feb 2015 05:35:01 +0000 (13:35 +0800)
committerByron Jones <glob@mozilla.com>
Fri, 20 Feb 2015 05:35:01 +0000 (13:35 +0800)
r=dylan,a=glob

Bugzilla/DB/Mysql.pm

index ef983ce556eb5b9c2839eb971cbc1628af2dacc5..389cc6baa9c25c1756b52e6846e4d408cc87ec05 100644 (file)
@@ -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