diff options
author | lpsolit%gmail.com <> | 2005-07-19 23:33:40 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-07-19 23:33:40 +0200 |
commit | 20e0d1f73fdaf8954941ce65d0a976d1c620e954 (patch) | |
tree | 032ee3afc2d8c1724dfdfa23870d7f5f157819f7 | |
parent | 534173a0d5d06a945cd48da84815e4f003ebf727 (diff) | |
download | bugzilla-20e0d1f73fdaf8954941ce65d0a976d1c620e954.tar.gz bugzilla-20e0d1f73fdaf8954941ce65d0a976d1c620e954.tar.xz |
Bug 300709: Avoid the use of SELECT * - Patch by Frédéric Buclin <LpSolit@gmail.com> r=glob a=myk
-rw-r--r-- | Bugzilla/User.pm | 2 | ||||
-rwxr-xr-x | collectstats.pl | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 847319c18..494876b31 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 eca072e61..a12c85586 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; } |