From adff3a725c8bee4d7269f14572dccc38bcbd129f Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 19 Jul 2005 21:38:33 +0000 Subject: [PATCH] =?utf8?q?Bug=20300709:=20Avoid=20the=20use=20of=20SELECT?= =?utf8?q?=20*=20-=20Patch=20by=20Fr=C3=A9d=C3=A9ric=20Buclin=20=20r=3Dglob=20a=3Dmyk?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- collectstats.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/collectstats.pl b/collectstats.pl index 23d01bbc42..0ad9e73a1c 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -181,11 +181,11 @@ FIN } sub calculate_dupes { - SendSQL("SELECT * FROM duplicates"); + my $dbh = Bugzilla->dbh; + my $rows = $dbh->selectall_arrayref("SELECT dupe_of, dupe FROM duplicates"); my %dupes; my %count; - my @row; my $key; my $changed = 1; @@ -203,9 +203,8 @@ sub calculate_dupes { # Create a hash with key "a bug number", value "bug which that bug is a # direct dupe of" - straight from the duplicates table. - while (@row = FetchSQLData()) { - my $dupe_of = shift @row; - my $dupe = shift @row; + foreach my $row (@$rows) { + my ($dupe_of, $dupe) = @$row; $dupes{$dupe} = $dupe_of; } -- 2.47.3