summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r--Bugzilla/DB.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index 33801e989..80404131a 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -350,6 +350,14 @@ sub import {
$Exporter::ExportLevel-- if $is_exporter;
}
+sub sql_prefix_match {
+ my ($self, $column, $str) = @_;
+ my $must_escape = $str =~ s/([_%!])/!$1/g;
+ my $escape = $must_escape ? q/ESCAPE '!'/ : '';
+ my $quoted_str = $self->quote("$str%");
+ return "$column LIKE $quoted_str $escape";
+}
+
sub sql_istrcmp {
my ($self, $left, $right, $op) = @_;
$op ||= "=";