From b9402d3e113b408143c7ad18f1cb798023c7d178 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sat, 19 Feb 2005 00:14:26 +0000 Subject: Bug 280497: Replace "LIMIT" with Bugzilla::DB function call Patch By Tomas Kopal r=mkanat,a=justdave --- collectstats.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'collectstats.pl') 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]; -- cgit v1.2.3-24-g4f1b