summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-17 03:40:12 +0100
committermkanat%kerio.com <>2005-02-17 03:40:12 +0100
commitdb654f60eee16ea5065f1b491ddcc7d74b401531 (patch)
tree570b970b539ee1aedb45a54cfe5d7c1d270a957c /Bugzilla/Search.pm
parent62b2ec349b01a454420eaadd22caad929521a76e (diff)
downloadbugzilla-db654f60eee16ea5065f1b491ddcc7d74b401531.tar.gz
bugzilla-db654f60eee16ea5065f1b491ddcc7d74b401531.tar.xz
Bug 280495: Replace "REGEXP" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=wurblzap, a=myk
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 05cdc21f0..7740e7402 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -95,6 +95,8 @@ sub init {
my @andlist;
my %chartfields;
+ my $dbh = Bugzilla->dbh;
+
&::GetVersionTable();
# First, deal with all the old hard-coded non-chart-based poop.
@@ -677,9 +679,9 @@ sub init {
} elsif ($t eq "notequal") {
$oper = "<>";
} elsif ($t eq "regexp") {
- $oper = "REGEXP";
+ $oper = $dbh->sql_regexp();
} elsif ($t eq "notregexp") {
- $oper = "NOT REGEXP";
+ $oper = $dbh->sql_not_regexp();
} else {
$oper = "noop";
}
@@ -950,10 +952,10 @@ sub init {
$term = "INSTR(LOWER($ff), " . lc($q) . ") = 0";
},
",regexp" => sub {
- $term = "LOWER($ff) REGEXP $q";
+ $term = "LOWER($ff) " . $dbh->sql_regexp() . " $q";
},
",notregexp" => sub {
- $term = "LOWER($ff) NOT REGEXP $q";
+ $term = "LOWER($ff) " . $dbh->sql_not_regexp() . " $q";
},
",lessthan" => sub {
$term = "$ff < $q";
@@ -1434,6 +1436,7 @@ sub build_subselect {
sub GetByWordList {
my ($field, $strs) = (@_);
my @list;
+ my $dbh = Bugzilla->dbh;
foreach my $w (split(/[\s,]+/, $strs)) {
my $word = $w;
@@ -1443,7 +1446,7 @@ sub GetByWordList {
$word =~ s/^'//;
$word =~ s/'$//;
$word = '(^|[^a-z0-9])' . $word . '($|[^a-z0-9])';
- push(@list, "lower($field) regexp '$word'");
+ push(@list, "lower($field) " . $dbh->sql_regexp() . " '$word'");
}
}