[bugzilla-gnome-org-extensions] patch report: Fix interval computations



commit dfb60d9d2df8374570d19d225bc20260d73e9ff9
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Wed Nov 19 13:09:02 2014 +0100

    patch report: Fix interval computations
    
    sql_interval is probably a remnant from 3.6. Closest thing to it I
    could find is sql_date_math.

 PatchReport/lib/Util.pm |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/PatchReport/lib/Util.pm b/PatchReport/lib/Util.pm
index b73b84e..88456c2 100644
--- a/PatchReport/lib/Util.pm
+++ b/PatchReport/lib/Util.pm
@@ -144,12 +144,12 @@ sub get_unreviewed_patches_and_stats {
       $query .= " AND attachments.submitter_id = $submitter";
     }
     if ($min_days && $min_days != -1) {
-      $query .= " AND attachments.creation_ts <= LOCALTIMESTAMP(0) - " .
-          $dbh->sql_interval($min_days, 'DAY');
+      $query .= " AND attachments.creation_ts <= " .
+          $dbh->sql_date_math('LOCALTIMESTAMP(0)', '-', $min_days, 'DAY');
     }
     if ($max_days && $max_days != -1) {
-      $query .= " AND attachments.creation_ts >= LOCALTIMESTAMP(0) - " .
-          $dbh->sql_interval($max_days, 'DAY');
+      $query .= " AND attachments.creation_ts >= " .
+          $dbh->sql_date_math('LOCALTIMESTAMP(0)', '-', $max_days, 'DAY');
     }
     if ($patch_status eq 'obsolete') {
       $query .= " AND attachments.isobsolete  = '1'";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]