summaryrefslogtreecommitdiffstats
path: root/collectstats.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-12-23 11:01:51 +0100
committerlpsolit%gmail.com <>2005-12-23 11:01:51 +0100
commit598f0d1a8db925cdb235d401554f1a403f506358 (patch)
treea2772c8ef7f20ef71432257cdbe8ac970c4891b9 /collectstats.pl
parentac921416d48a3a2b5f43bb9f6a88cb7fee15f469 (diff)
downloadbugzilla-598f0d1a8db925cdb235d401554f1a403f506358.tar.gz
bugzilla-598f0d1a8db925cdb235d401554f1a403f506358.tar.xz
Bug 316971: [PostgreSQL] ./collectstats.pl --regenerate fails - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=justdave
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-xcollectstats.pl14
1 files changed, 7 insertions, 7 deletions
diff --git a/collectstats.pl b/collectstats.pl
index e087c28d0..2d7d3d258 100755
--- a/collectstats.pl
+++ b/collectstats.pl
@@ -286,7 +286,7 @@ sub regenerate_stats {
$dbh->sql_to_days('current_date') . " AS end, " .
$dbh->sql_to_days("'1970-01-01'") .
" FROM bugs $from_product WHERE " .
- $dbh->sql_to_days('creation_ts') . " != 'NULL'" .
+ $dbh->sql_to_days('creation_ts') . " IS NOT NULL " .
$and_product .
" ORDER BY start " . $dbh->sql_limit(1));
@@ -316,8 +316,8 @@ FIN
# Get a list of bugs that were created the previous day, and
# add those bugs to the list of bugs for this product.
SendSQL("SELECT bug_id FROM bugs $from_product " .
- "WHERE bugs.creation_ts < from_days(" . ($day - 1) . ") " .
- "AND bugs.creation_ts >= from_days(" . ($day - 2) . ") " .
+ " WHERE bugs.creation_ts < " . $dbh->sql_from_days($day - 1) .
+ " AND bugs.creation_ts >= " . $dbh->sql_from_days($day - 2) .
$and_product .
" ORDER BY bug_id");
@@ -354,8 +354,8 @@ FIN
" ON bugs_activity.fieldid = fielddefs.fieldid " .
" WHERE fielddefs.name = 'bug_status' " .
" AND bugs_activity.bug_id = $bug " .
- " AND bugs_activity.bug_when >= from_days($day) " .
- "ORDER BY bugs_activity.bug_when " .
+ " AND bugs_activity.bug_when >= " . $dbh->sql_from_days($day) .
+ " ORDER BY bugs_activity.bug_when " .
$dbh->sql_limit(1));
my $status;
@@ -377,8 +377,8 @@ FIN
" ON bugs_activity.fieldid = fielddefs.fieldid " .
" WHERE fielddefs.name = 'resolution' " .
" AND bugs_activity.bug_id = $bug " .
- " AND bugs_activity.bug_when >= from_days($day) " .
- "ORDER BY bugs_activity.bug_when " .
+ " AND bugs_activity.bug_when >= " . $dbh->sql_from_days($day) .
+ " ORDER BY bugs_activity.bug_when " .
$dbh->sql_limit(1));
if (@row = FetchSQLData()) {