From: Sam Morris
Date: Tue, 1 Mar 2011 13:43:24 +0000 (-0800)
Subject: Bug 634144: Make possible_duplicates work on PostgreSQL
X-Git-Tag: bugzilla-4.0.1~25
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=118b673cd102c7f9bbdabc5263dcf3387c4c567a;p=thirdparty%2Fbugzilla.git
Bug 634144: Make possible_duplicates work on PostgreSQL
r=mkanat, a=mkanat
---
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index cda668b91a..9ebee1264b 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -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
-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
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 025c11e8c9..2e43d8273a 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -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)";
}
diff --git a/template/en/default/pages/release-notes.html.tmpl b/template/en/default/pages/release-notes.html.tmpl
index 55141d1e2b..29936d68c3 100644
--- a/template/en/default/pages/release-notes.html.tmpl
+++ b/template/en/default/pages/release-notes.html.tmpl
@@ -166,9 +166,6 @@
much faster on installations that run under mod_perl than it will
be on other installations.
-This automatic duplicate detection does not currently work for installations
- running on PostgreSQL.
-
New Advanced Search UI
Thanks to the UI work of Guy