summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB.pm4
-rw-r--r--Bugzilla/DB/Mysql.pm4
-rw-r--r--Bugzilla/DB/Pg.pm4
-rw-r--r--Bugzilla/Search.pm2
-rw-r--r--Bugzilla/Token.pm2
5 files changed, 8 insertions, 8 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm
index f031637d5..09c941ec8 100644
--- a/Bugzilla/DB.pm
+++ b/Bugzilla/DB.pm
@@ -1146,8 +1146,8 @@ formatted SQL command have prefix C<sql_>. All other methods have prefix C<bz_>.
Description: Outputs proper SQL syntax for a time interval function.
Abstract method, should be overriden by database specific code.
- Params: $interval = the time interval requested (e.g. '30 minutes')
- (scalar)
+ Params: $interval - the time interval requested (e.g. '30') (integer)
+ $units - the units the interval is in (e.g. 'MINUTE') (string)
Returns: formatted SQL for interval function (scalar)
=item C<sql_position>
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 952d49ff9..a8f78bb9a 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -148,9 +148,9 @@ sub sql_date_format {
}
sub sql_interval {
- my ($self, $interval) = @_;
+ my ($self, $interval, $units) = @_;
- return "INTERVAL $interval";
+ return "INTERVAL $interval $units";
}
sub sql_position {
diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm
index ff1e6abae..f4569b9fd 100644
--- a/Bugzilla/DB/Pg.pm
+++ b/Bugzilla/DB/Pg.pm
@@ -135,9 +135,9 @@ sub sql_date_format {
}
sub sql_interval {
- my ($self, $interval) = @_;
+ my ($self, $interval, $units) = @_;
- return "INTERVAL '$interval'";
+ return "$interval * INTERVAL '1 $units'";
}
sub sql_string_concat {
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 468457844..cc24d11e0 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -996,7 +996,7 @@ sub init {
$unitinterval = 'YEAR';
}
my $cutoff = "NOW() - " .
- $dbh->sql_interval("$quantity $unitinterval");
+ $dbh->sql_interval($quantity, $unitinterval);
my $assigned_fieldid = get_field_id('assigned_to');
push(@supptables, "LEFT JOIN longdescs AS comment_$table " .
"ON comment_$table.who = bugs.assigned_to " .
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index 6a263cbee..42dca47d6 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -103,7 +103,7 @@ sub IssuePasswordToken {
ON tokens.userid = profiles.userid
AND tokens.tokentype = 'password'
AND tokens.issuedate > NOW() - " .
- $dbh->sql_interval('10 MINUTE') . "
+ $dbh->sql_interval(10, 'MINUTE') . "
WHERE " . $dbh->sql_istrcmp('login_name', $quotedloginname));
my ($userid, $toosoon) = &::FetchSQLData();