From 20fb3d39980ab048132361631dfe8ee8e4e9a305 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 20 Aug 2008 02:35:15 +0000 Subject: A fix for bug 446645--make hyphens at the beginning of words still count as negation for fulltext searching in MySQL. Patch By Jesse Clark r=mkanat, a=mkanat --- Bugzilla/DB/Mysql.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Bugzilla/DB/Mysql.pm') diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index d645d79c5..2f42f9f34 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -157,10 +157,10 @@ sub sql_fulltext_search { $mode = 'IN BOOLEAN MODE'; # quote un-quoted compound words - my @words = quotewords('[\s()]+', 'delimiter', $text); + my @words = quotewords('[\s()]+', 'delimiters', $text); foreach my $word (@words) { - # match words that have word chars, non-word chars, and no quotes - if ($word =~ /\w/ && $word =~ m/\W/ && $word !~ m/"/) { + # match words that have non-word chars in the middle of them + if ($word =~ /\w\W+\w/ && $word !~ m/"/) { $word = '"' . $word . '"'; } } -- cgit v1.2.3-24-g4f1b