summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjocuri%softhome.net <>2006-02-28 08:11:59 +0100
committerjocuri%softhome.net <>2006-02-28 08:11:59 +0100
commitba36fe893bb445a504f5f56b4216abc23ec1f639 (patch)
tree2f32a6c240ce6c09893bca2c308d61a05986ce6e
parentab055bf4f6afe05ac6501077ed97ebc5af9532c5 (diff)
downloadbugzilla-ba36fe893bb445a504f5f56b4216abc23ec1f639.tar.gz
bugzilla-ba36fe893bb445a504f5f56b4216abc23ec1f639.tar.xz
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.
-rwxr-xr-xwhine.pl12
1 files changed, 6 insertions, 6 deletions
diff --git a/whine.pl b/whine.pl
index 36c405d15..2fd80a3e3 100755
--- a/whine.pl
+++ b/whine.pl
@@ -175,8 +175,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);
@@ -192,8 +192,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);
@@ -601,8 +601,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);