From e4fa51953ec018c733040ccf9a478b2e8aac0bac Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 14 Nov 2005 01:32:10 +0000 Subject: Bug 301062: [PostgreSQL] whine.pl fails when using PostgreSQL 8.0.x - Patch by Frédéric Buclin r=mkanat r=manu a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/DB.pm | 4 ++-- Bugzilla/DB/Mysql.pm | 4 ++-- Bugzilla/DB/Pg.pm | 4 ++-- Bugzilla/Search.pm | 2 +- Bugzilla/Token.pm | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Bugzilla') 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. All other methods have prefix C. 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 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(); -- cgit v1.2.3-24-g4f1b