summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-06-04 07:54:27 +0200
committerByron Jones <bjones@mozilla.com>2013-06-04 07:54:27 +0200
commit0d99deaf5b2ba41f425f0fb4092ef36d418654bb (patch)
tree3b151ac1a7359fd012337e479db1652383efe615
parentd9e7206e6bcc83bc6387b7e98438395fbf4b3a02 (diff)
downloadbugzilla-0d99deaf5b2ba41f425f0fb4092ef36d418654bb.tar.gz
bugzilla-0d99deaf5b2ba41f425f0fb4092ef36d418654bb.tar.xz
Bug 879055: anywordssubstr search returns incorrect results
-rw-r--r--Bugzilla/Search.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index a27d3fe64..d393a9918 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -2700,7 +2700,7 @@ sub _owner_idle_time_greater_less {
"$ld_table.who IS NULL AND $act_table.who IS NULL";
} else {
$args->{term} =
- "$ld_table.who IS NOT NULL OR $act_table.who IS NOT NULL";
+ "($ld_table.who IS NOT NULL OR $act_table.who IS NOT NULL)";
}
}
@@ -2944,14 +2944,14 @@ sub _anywordsubstr {
my ($self, $args) = @_;
my @terms = $self->_substring_terms($args);
- $args->{term} = join("\n\tOR ", @terms);
+ $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
}
sub _allwordssubstr {
my ($self, $args) = @_;
my @terms = $self->_substring_terms($args);
- $args->{term} = join("\n\tAND ", @terms);
+ $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
}
sub _nowordssubstr {
@@ -2963,19 +2963,19 @@ sub _nowordssubstr {
sub _anywords {
my ($self, $args) = @_;
-
+
my @terms = $self->_word_terms($args);
# Because _word_terms uses AND, we need to parenthesize its terms
# if there are more than one.
@terms = map("($_)", @terms) if scalar(@terms) > 1;
- $args->{term} = join("\n\tOR ", @terms);
+ $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
}
sub _allwords {
my ($self, $args) = @_;
-
+
my @terms = $self->_word_terms($args);
- $args->{term} = join("\n\tAND ", @terms);
+ $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
}
sub _nowords {