]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 300709: Avoid the use of SELECT * - Patch by Frédéric Buclin <LpSolit@gmail.com...
authorlpsolit%gmail.com <>
Tue, 19 Jul 2005 21:35:57 +0000 (21:35 +0000)
committerlpsolit%gmail.com <>
Tue, 19 Jul 2005 21:35:57 +0000 (21:35 +0000)
Bugzilla/User.pm
collectstats.pl

index 847319c1876a61904f841f400b6d510608d1d75e..494876b31e4b2d93fcd251f2984e16a23ca77a4e 100644 (file)
@@ -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 
index eca072e615e7300fba0337147a7fd3371a300f7b..a12c85586cf05ef7d8bf3796ca24687b51c90261 100755 (executable)
@@ -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;
     }