summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-18 02:52:52 +0200
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-07-18 02:52:52 +0200
commit7b5e8372bf4306cf99eddb474bd8b7754510a683 (patch)
tree4426d79fcdf18bc740273d852f8b0eeda6f1e13c /Bugzilla/DB.pm
parent0087cc076fc48f24b73e8aa0935941a7b9a2b6d8 (diff)
downloadbugzilla-7b5e8372bf4306cf99eddb474bd8b7754510a683.tar.gz
bugzilla-7b5e8372bf4306cf99eddb474bd8b7754510a683.tar.xz
Bug 579568: Search.pm: Improve the implementation and performance of
substring and "words" searches, improve the formatting of generated SQL, and use real subselects instead of performing the subselect and using its results in an IN. r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 31051dd8e..117c3a7b0 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -78,6 +78,21 @@ use constant ENUM_DEFAULTS => {
# Used by Bugzilla::Bug::possible_duplicates.
use constant FULLTEXT_OR => '';
+# These are used in regular expressions to mean "the start or end of a word".
+#
+# We don't use [[:<:]] and [[:>:]], even though they mean
+# "start and end of a word" and are supported by both MySQL and PostgreSQL,
+# because they don't work if your search starts or ends with a non-alphanumeric
+# character, and there's a fair chance somebody will want to use the "word"
+# search to search flags for something like "review+".
+#
+# We do use [:almum:] because it is supported by at least MySQL and
+# PostgreSQL, and hopefully will get us as much Unicode support as possible,
+# depending on how well the regexp engines of the various databases support
+# Unicode.
+use constant WORD_START => '(^|[^[:alnum:]])';
+use constant WORD_END => '($|[^[:alnum:]])';
+
#####################################################################
# Connection Methods
#####################################################################