summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-07-10 21:17:08 +0200
committerGitHub <noreply@github.com>2018-07-10 21:17:08 +0200
commit8de2aaf9e213651afaf12ec10b1091c22b7a9c55 (patch)
tree37120f452afdaadbb44c5a81de9d0958325da023 /Bugzilla/DB.pm
parent446a08b30b0dbaac9f2b88e0a5cad410f0446140 (diff)
downloadbugzilla-8de2aaf9e213651afaf12ec10b1091c22b7a9c55.tar.gz
bugzilla-8de2aaf9e213651afaf12ec10b1091c22b7a9c55.tar.xz
Bug 1469911 - Make user autocompletion faster
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 ||= "=";