diff options
author | mkanat%kerio.com <> | 2005-02-20 17:02:06 +0100 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-02-20 17:02:06 +0100 |
commit | d7958942a691a719be4d3433b5a24817c8646f9a (patch) | |
tree | 179648890480c617db96828c6b2a705f74a04d2d /sanitycheck.cgi | |
parent | e547dd6d7b7b9a3c2135c56dd6b7a433743fd4b1 (diff) | |
download | bugzilla-d7958942a691a719be4d3433b5a24817c8646f9a.tar.gz bugzilla-d7958942a691a719be4d3433b5a24817c8646f9a.tar.xz |
Bug 280502: Replace "INTERVAL" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=justdave
Diffstat (limited to 'sanitycheck.cgi')
-rwxr-xr-x | sanitycheck.cgi | 10 |
1 files changed, 6 insertions, 4 deletions
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); |