summaryrefslogtreecommitdiffstats
path: root/collectstats.pl
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-19 01:14:26 +0100
committermkanat%kerio.com <>2005-02-19 01:14:26 +0100
commitb9402d3e113b408143c7ad18f1cb798023c7d178 (patch)
treeead35cce72a5f7be7fa8660561159eca2174185d /collectstats.pl
parent62eecf24480520e204ab0057f8f7845c13f37c13 (diff)
downloadbugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.tar.gz
bugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.tar.xz
Bug 280497: Replace "LIMIT" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat,a=justdave
Diffstat (limited to 'collectstats.pl')
-rwxr-xr-xcollectstats.pl11
1 files changed, 7 insertions, 4 deletions
diff --git a/collectstats.pl b/collectstats.pl
index 23d01bbc4..cf863f405 100755
--- a/collectstats.pl
+++ b/collectstats.pl
@@ -258,8 +258,9 @@ sub calculate_dupes {
sub regenerate_stats {
my $dir = shift;
my $product = shift;
- my $when = localtime(time());
+ my $dbh = Bugzilla->dbh;
+ my $when = localtime(time());
my $tstart = time();
# NB: Need to mangle the product for the filename, but use the real
@@ -287,7 +288,7 @@ sub regenerate_stats {
"to_days('1970-01-01') " .
"FROM bugs $from_product WHERE to_days(creation_ts) != 'NULL' " .
$and_product .
- "ORDER BY start LIMIT 1");
+ "ORDER BY start " . $dbh->sql_limit(1));
my ($start, $end, $base) = FetchSQLData();
if (!defined $start) {
@@ -353,7 +354,8 @@ FIN
"AND fielddefs.name = 'bug_status' " .
"AND bugs_activity.bug_id = $bug " .
"AND bugs_activity.bug_when >= from_days($day) " .
- "ORDER BY bugs_activity.bug_when LIMIT 1");
+ "ORDER BY bugs_activity.bug_when " .
+ $dbh->sql_limit(1));
my $status;
if (@row = FetchSQLData()) {
@@ -374,7 +376,8 @@ FIN
"AND fielddefs.name = 'resolution' " .
"AND bugs_activity.bug_id = $bug " .
"AND bugs_activity.bug_when >= from_days($day) " .
- "ORDER BY bugs_activity.bug_when LIMIT 1");
+ "ORDER BY bugs_activity.bug_when " .
+ $dbh->sql_limit(1));
if (@row = FetchSQLData()) {
$status = $row[0];