Commit 20e0d1f7 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 300709: Avoid the use of SELECT * - Patch by Frédéric Buclin <LpSolit@gmail.com> r=glob a=myk

parent 534173a0
...@@ -1078,7 +1078,7 @@ sub wants_mail { ...@@ -1078,7 +1078,7 @@ sub wants_mail {
} }
my $wants_mail = my $wants_mail =
$dbh->selectrow_array("SELECT * $dbh->selectrow_array("SELECT 1
FROM email_setting FROM email_setting
WHERE user_id = $self->{'id'} WHERE user_id = $self->{'id'}
AND relationship = $relationship AND relationship = $relationship
......
...@@ -181,11 +181,11 @@ FIN ...@@ -181,11 +181,11 @@ FIN
} }
sub calculate_dupes { 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 %dupes;
my %count; my %count;
my @row;
my $key; my $key;
my $changed = 1; my $changed = 1;
...@@ -203,9 +203,8 @@ sub calculate_dupes { ...@@ -203,9 +203,8 @@ sub calculate_dupes {
# Create a hash with key "a bug number", value "bug which that bug is a # Create a hash with key "a bug number", value "bug which that bug is a
# direct dupe of" - straight from the duplicates table. # direct dupe of" - straight from the duplicates table.
while (@row = FetchSQLData()) { foreach my $row (@$rows) {
my $dupe_of = shift @row; my ($dupe_of, $dupe) = @$row;
my $dupe = shift @row;
$dupes{$dupe} = $dupe_of; $dupes{$dupe} = $dupe_of;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment