]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 634144: Make possible_duplicates work on PostgreSQL
authorSam Morris <sam@robots.org.uk>
Tue, 1 Mar 2011 13:43:24 +0000 (05:43 -0800)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Tue, 1 Mar 2011 13:43:24 +0000 (05:43 -0800)
r=mkanat, a=mkanat

Bugzilla/DB.pm
Bugzilla/Search.pm
template/en/default/pages/release-notes.html.tmpl

index cda668b91ab48e1cfa14a3da78aa3a8aa20ef1a2..9ebee1264b1d0ef3494ea711b7b53ab1f355d497 100644 (file)
@@ -411,7 +411,7 @@ sub sql_fulltext_search {
     @words = map("LOWER($column) LIKE $_", @words);
 
     # search for occurrences of all specified words in the column
-    return "CASE WHEN (" . join(" AND ", @words) . ") THEN 1 ELSE 0 END";
+    return join (" AND ", @words), "CASE WHEN (" . join(" AND ", @words) . ") THEN 1 ELSE 0 END";
 }
 
 #####################################################################
@@ -1958,8 +1958,17 @@ Note that both parameters need to be sql-quoted.
 
 =item B<Description>
 
-Returns SQL syntax for performing a full text search for specified text 
-on a given column.
+Returns one or two SQL expressions for performing a full text search for
+specified text on a given column.
+
+If one value is returned, it is a numeric expression that indicates
+a match with a positive value and a non-match with zero. In this case,
+the DB must support casting numeric expresions to booleans.
+
+If the DB does not support casting numeric expresions to booleans, then
+the first value is a boolean expression that indicates the presence of
+a match, and the second value is a numeric expression that can be
+used for ranking.
 
 There is a ANSI SQL version of this method implemented using LIKE operator,
 but it's not a real full text search. DB specific modules should override 
index 025c11e8c90c077380a4ae574a084b08f6fedc55..2e43d8273a4650d1cf87021ec1b45cdc047dc281 100644 (file)
@@ -1646,7 +1646,7 @@ sub _content_matches {
     $rterm2 = $term2 if !$rterm2;
 
     # The term to use in the WHERE clause.
-    $$term = "$term1 > 0 OR $term2 > 0";
+    $$term = "$term1 OR $term2";
     if ($$t =~ /not/i) {
         $$term = "NOT($$term)";
     }
index 55141d1e2bdea461385150fd3255a5683a49814e..29936d68c3bddb42663fd8776d053a6552bcf612 100644 (file)
   much faster on installations that run under mod_perl than it will
   be on other installations.</p>
 
-<p>This automatic duplicate detection does not currently work for installations
-  running on PostgreSQL.</p>
-
 <h3 id="v40_feat_search_ui">New Advanced Search UI</h3>
 
 <p>Thanks to the UI work of <a href="http://guy-pyrzak.blogspot.com/">Guy