From d7958942a691a719be4d3433b5a24817c8646f9a Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sun, 20 Feb 2005 16:02:06 +0000 Subject: Bug 280502: Replace "INTERVAL" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat, a=justdave --- sanitycheck.cgi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sanitycheck.cgi') diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 1696a3e7a..f58995d26 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -144,7 +144,8 @@ if (defined $cgi->param('cleangroupsnow')) { # to get the groups up to date. # If any page starts taking longer than one hour to load, this interval # should be revised. - SendSQL("SELECT MAX(last_changed) FROM groups WHERE last_changed < NOW() - INTERVAL 1 HOUR"); + SendSQL("SELECT MAX(last_changed) FROM groups WHERE last_changed < NOW() - " . + $dbh->sql_interval('1 HOUR')); (my $cutoff) = FetchSQLData(); Status("Cutoff is $cutoff"); SendSQL("SELECT COUNT(*) FROM user_group_map"); @@ -175,7 +176,8 @@ if (defined $cgi->param('rescanallBugMail')) { Status("OK, now attempting to send unsent mail"); SendSQL("SELECT bug_id FROM bugs WHERE lastdiffed < delta_ts AND - delta_ts < date_sub(now(), INTERVAL 30 minute) ORDER BY bug_id"); + delta_ts < date_sub(now(), " . $dbh->sql_interval('30 minute') . + " ORDER BY bug_id"); my @list; while (MoreSQLData()) { push (@list, FetchOneColumn()); @@ -738,8 +740,8 @@ Status("Checking for unsent mail"); SendSQL("SELECT bug_id " . "FROM bugs WHERE lastdiffed < delta_ts AND ". - "delta_ts < date_sub(now(), INTERVAL 30 minute) ". - "ORDER BY bug_id"); + "delta_ts < date_sub(now(), " . $dbh->sql_interval('30 minute') . + " ORDER BY bug_id"); while (@row = FetchSQLData()) { my ($id) = (@row); -- cgit v1.2.3-24-g4f1b