diff options
author | 2005-02-19 00:14:26 +0000 | |
---|---|---|
committer | 2005-02-19 00:14:26 +0000 | |
commit | b9402d3e113b408143c7ad18f1cb798023c7d178 (patch) | |
tree | ead35cce72a5f7be7fa8660561159eca2174185d /collectstats.pl | |
parent | Bug 280494: Replace "SELECT LAST_INSERT_ID()" with Bugzilla::DB function call (diff) | |
download | bugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.tar.gz bugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.tar.bz2 bugzilla-b9402d3e113b408143c7ad18f1cb798023c7d178.zip |
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-x | collectstats.pl | 11 |
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]; |