]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 880315: Fix malformed sql generated by the fix for bug 879055
authorByron Jones <bjones@mozilla.com>
Fri, 7 Jun 2013 05:28:24 +0000 (13:28 +0800)
committerByron Jones <bjones@mozilla.com>
Fri, 7 Jun 2013 05:28:24 +0000 (13:28 +0800)
r=LpSolit, a=LpSolit

Bugzilla/Search.pm

index 6c5e04088bb7da822a717b1ba964f31ff73f7cc6..fba6ea07d0cdc45f7e34f6958ed6046f0c0b6c89 100644 (file)
@@ -2903,14 +2903,14 @@ sub _anywordsubstr {
     my ($self, $args) = @_;
 
     my @terms = $self->_substring_terms($args);
-    $args->{term} = '(' . join("\n\tOR ", @terms) . ')';
+    $args->{term} = @terms ? '(' . join("\n\tOR ", @terms) . ')' : '';
 }
 
 sub _allwordssubstr {
     my ($self, $args) = @_;
 
     my @terms = $self->_substring_terms($args);
-    $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
+    $args->{term} = @terms ? '(' . join("\n\tAND ", @terms) . ')' : '';
 }
 
 sub _nowordssubstr {
@@ -2927,14 +2927,14 @@ sub _anywords {
     # 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} = @terms ? '(' . join("\n\tOR ", @terms) . ')' : '';
 }
 
 sub _allwords {
     my ($self, $args) = @_;
 
     my @terms = $self->_word_terms($args);
-    $args->{term} = '(' . join("\n\tAND ", @terms) . ')';
+    $args->{term} = @terms ? '(' . join("\n\tAND ", @terms) . ')' : '';
 }
 
 sub _nowords {