From: jocuri%softhome.net <> Date: Tue, 28 Feb 2006 07:13:10 +0000 (+0000) Subject: Patch for bug 327348: Fix whining failure in whine.pl, on MySQL 4.0, due to multiple... X-Git-Tag: bugzilla-2.20.2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecb9625fa649531aa4a154f77ee4bb46f85a33f0;p=thirdparty%2Fbugzilla.git Patch for bug 327348: Fix whining failure in whine.pl, on MySQL 4.0, due to multiple date addition; r=LpSolit, r=wurblzap, a=justdave. --- diff --git a/whine.pl b/whine.pl index e584646f5b..7ae4b5b40b 100755 --- a/whine.pl +++ b/whine.pl @@ -181,8 +181,8 @@ while (my ($schedule_id, $day, $time) = $sched_h->fetchrow_array) { else { # set it for the next applicable day $day = &get_next_date($day); $sth = $dbh->prepare("UPDATE whine_schedules " . - "SET run_next = CURRENT_DATE + " . - $dbh->sql_interval('?', 'DAY') . " + " . + "SET run_next = (CURRENT_DATE + " . + $dbh->sql_interval('?', 'DAY') . ") + " . $dbh->sql_interval('?', 'HOUR') . " WHERE id = ?"); $sth->execute($day, $time, $schedule_id); @@ -198,8 +198,8 @@ while (my ($schedule_id, $day, $time) = $sched_h->fetchrow_array) { my $target_time = ($time =~ /^\d+$/) ? $time : 0; $sth = $dbh->prepare("UPDATE whine_schedules " . - "SET run_next = CURRENT_DATE + " . - $dbh->sql_interval('?', 'DAY') . " + " . + "SET run_next = (CURRENT_DATE + " . + $dbh->sql_interval('?', 'DAY') . ") + " . $dbh->sql_interval('?', 'HOUR') . " WHERE id = ?"); $sth->execute($target_date, $target_time, $schedule_id); @@ -605,8 +605,8 @@ sub reset_timer { my $nextdate = &get_next_date($run_day); $sth = $dbh->prepare("UPDATE whine_schedules " . - "SET run_next = CURRENT_DATE + " . - $dbh->sql_interval('?', 'DAY') . " + " . + "SET run_next = (CURRENT_DATE + " . + $dbh->sql_interval('?', 'DAY') . ") + " . $dbh->sql_interval('?', 'HOUR') . " WHERE id = ?"); $sth->execute($nextdate, $target_time, $schedule_id);