From: lpsolit%gmail.com <> Date: Tue, 19 Jul 2005 21:35:57 +0000 (+0000) Subject: Bug 300709: Avoid the use of SELECT * - Patch by Frédéric Buclin r=glob a=myk --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 847319c187..494876b31e 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1078,7 +1078,7 @@ sub wants_mail { } my $wants_mail = - $dbh->selectrow_array("SELECT * + $dbh->selectrow_array("SELECT 1 FROM email_setting WHERE user_id = $self->{'id'} AND relationship = $relationship diff --git a/collectstats.pl b/collectstats.pl index eca072e615..a12c85586c 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; }