summaryrefslogtreecommitdiffstats
path: root/whine.pl
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2013-01-16 19:05:22 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2013-01-16 19:05:22 +0100
commitd8643908a7d6243c361e670573af763067db408d (patch)
treeb8e5b5df199351e6455843fc27a4c4e1e30433d9 /whine.pl
parent7b6b9a789a2bfc5707ba1eb85ad7ba5245af64a3 (diff)
downloadbugzilla-d8643908a7d6243c361e670573af763067db408d.tar.gz
bugzilla-d8643908a7d6243c361e670573af763067db408d.tar.xz
Bug 819432: Execute queries in two steps to improve performance
r=dkl a=LpSolit
Diffstat (limited to 'whine.pl')
-rwxr-xr-xwhine.pl9
1 files changed, 3 insertions, 6 deletions
diff --git a/whine.pl b/whine.pl
index 481b47425..f7ed6d5c7 100755
--- a/whine.pl
+++ b/whine.pl
@@ -453,7 +453,7 @@ sub run_queries {
'order' => \@orderstrings
);
# If a query fails for whatever reason, it shouldn't kill the script.
- my $sqlquery = eval { $search->sql };
+ my $data = eval { $search->data };
if ($@) {
print STDERR get_text('whine_query_failed', { query_name => $thisquery->{'name'},
author => $args->{'author'},
@@ -461,15 +461,12 @@ sub run_queries {
next;
}
- $sth = $dbh->prepare($sqlquery);
- $sth->execute;
-
- while (my @row = $sth->fetchrow_array) {
+ foreach my $row (@$data) {
my $bug = {};
for my $field (@searchfields) {
my $fieldname = $field;
$fieldname =~ s/^bugs\.//; # No need for bugs.whatever
- $bug->{$fieldname} = shift @row;
+ $bug->{$fieldname} = shift @$row;
}
if ($thisquery->{'onemailperbug'}) {