aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-11-14 01:32:10 +0000
committerlpsolit%gmail.com <>2005-11-14 01:32:10 +0000
commite4fa51953ec018c733040ccf9a478b2e8aac0bac (patch)
tree9a6f7c55d364dc74747a726f4df0125e9ea69114 /Bugzilla
parentf0bcc18f7a676230d2d700dd2b56a9dc2620f80b (diff)
downloadbugs-e4fa51953ec018c733040ccf9a478b2e8aac0bac.tar
bugs-e4fa51953ec018c733040ccf9a478b2e8aac0bac.tar.gz
bugs-e4fa51953ec018c733040ccf9a478b2e8aac0bac.tar.bz2
bugs-e4fa51953ec018c733040ccf9a478b2e8aac0bac.tar.xz
bugs-e4fa51953ec018c733040ccf9a478b2e8aac0bac.zip
Bug 301062: [PostgreSQL] whine.pl fails when using PostgreSQL 8.0.x - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat r=manu a=justdave
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();