]> 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:38:33 +0000 (21:38 +0000)
committerlpsolit%gmail.com <>
Tue, 19 Jul 2005 21:38:33 +0000 (21:38 +0000)
collectstats.pl

index 23d01bbc42677b8c1f386fc9ea762b0006f41638..0ad9e73a1c8760b1b1e58a47f6c98541640b91d4 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;
     }