From e547dd6d7b7b9a3c2135c56dd6b7a433743fd4b1 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sun, 20 Feb 2005 15:53:16 +0000 Subject: Bug 280499: Replace "TO_DAYS()" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat, a=justdave --- whineatnews.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'whineatnews.pl') diff --git a/whineatnews.pl b/whineatnews.pl index 8e73e1b6d..d90e775fa 100755 --- a/whineatnews.pl +++ b/whineatnews.pl @@ -33,10 +33,12 @@ require "globals.pl"; use Bugzilla::BugMail; -SendSQL("select bug_id,short_desc,login_name from bugs,profiles where " . - "(bug_status = 'NEW' or bug_status = 'REOPENED') and " . - "to_days(now()) - to_days(delta_ts) > " . Param('whinedays') . - " and userid=assigned_to order by bug_id"); +my $dbh = Bugzilla->dbh; +SendSQL("SELECT bug_id, short_desc, login_name FROM bugs, profiles WHERE " . + "(bug_status = 'NEW' OR bug_status = 'REOPENED') AND " . + $dbh->sql_to_days('NOW()') . " - " . + $dbh->sql_to_days('delta_ts') . " > " . Param('whinedays') . + " AND userid = assigned_to ORDER BY bug_id"); my %bugs; my %desc; -- cgit v1.2.3-24-g4f1b