Changeset 1113

Show
Ignore:
Timestamp:
11/30/2006 10:13:37 AM (2 years ago)
Author:
dmorton
svk:copy_cache_prev:
1095
Message:

ref #356 thanks to riogeed on IRC, we came up with a query that works. The problem lies in the fact that the ? substitution breaks because the '? days' needs to be a complete value. I suppose we could conditionally change the values just before the execute, but I think internally it has to do a calculation much like this anyway.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/scripts/send-quarantine-digests.pl

    r1112 r1113  
    205205    or fatal(sprintf("Couldn't prepare query: %s", $dbh->errstr)); 
    206206 
    207 my $date_add = $dbType eq 'pg' ? "NOW() + INTERVAL ? DAY" 
     207# postgres has a strange calulation to avoid having to tack on "days" to the execute value... 
     208my $date_add = $dbType eq 'pg' ? "TO_TIMESTAMP(EXTRACT(EPOCH FROM TIMESTAMP 'NOW()') + (? * 86400))" 
    208209         : "DATE_ADD(NOW(), INTERVAL ? DAY)"; 
    209210$query = <<"endSQL;";