summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-19 01:14:26 +0100
committermkanat%kerio.com <>2005-02-19 01:14:26 +0100
commitb9402d3e113b408143c7ad18f1cb798023c7d178 (patch)
treeead35cce72a5f7be7fa8660561159eca2174185d /Bugzilla
parent62eecf24480520e204ab0057f8f7845c13f37c13 (diff)
downloadbugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.tar.gz
bugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.tar.xz
Bug 280497: Replace "LIMIT" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat,a=justdave
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm4
-rw-r--r--Bugzilla/Token.pm5
-rw-r--r--Bugzilla/User.pm5
3 files changed, 9 insertions, 5 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 7740e7402..816b4b0a1 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -1393,6 +1393,8 @@ sub ListIDsForEmail {
my $old = $self->{"emailcache"}{"$type,$email"};
return undef if ($old && $old eq "---");
return $old if $old;
+
+ my $dbh = Bugzilla->dbh;
my @list = ();
my $list = "---";
if ($type eq 'anyexact') {
@@ -1406,7 +1408,7 @@ sub ListIDsForEmail {
$list = join(',', @list);
} elsif ($type eq 'substring') {
&::SendSQL("SELECT userid FROM profiles WHERE INSTR(login_name, " .
- &::SqlQuote($email) . ") LIMIT 51");
+ &::SqlQuote($email) . ") " . $dbh->sql_limit(51));
while (&::MoreSQLData()) {
my ($id) = &::FetchSQLData();
push(@list, $id);
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index 9caf91ab2..548430847 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -260,10 +260,11 @@ sub HasEmailChangeToken {
# Returns an email change token if the user has one.
my ($userid) = @_;
-
+
+ my $dbh = Bugzilla->dbh;
&::SendSQL("SELECT token FROM tokens WHERE userid = $userid " .
"AND (tokentype = 'emailnew' OR tokentype = 'emailold') " .
- "LIMIT 1");
+ $dbh->sql_limit(1));
my ($token) = &::FetchSQLData();
return $token;
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm
index 67b79f168..0a67400b3 100644
--- a/Bugzilla/User.pm
+++ b/Bugzilla/User.pm
@@ -539,6 +539,7 @@ sub match {
my $wildstr = $str;
my $user = Bugzilla->user;
+ my $dbh = Bugzilla->dbh;
if ($wildstr =~ s/\*/\%/g && # don't do wildcards if no '*' in the string
Param('usermatchmode') ne 'off') { # or if we only want exact matches
@@ -561,7 +562,7 @@ sub match {
}
$query .= " AND disabledtext = '' " if $exclude_disabled;
$query .= "ORDER BY length(login_name) ";
- $query .= "LIMIT $limit " if $limit;
+ $query .= $dbh->sql_limit($limit) if $limit;
# Execute the query, retrieve the results, and make them into
# User objects.
@@ -611,7 +612,7 @@ sub match {
}
$query .= " AND disabledtext = '' " if $exclude_disabled;
$query .= "ORDER BY length(login_name) ";
- $query .= "LIMIT $limit " if $limit;
+ $query .= $dbh->sql_limit($limit) if $limit;
&::PushGlobalSQLState();
&::SendSQL($query);
push(@users, new Bugzilla::User(&::FetchSQLData())) while &::MoreSQLData();