summaryrefslogtreecommitdiffstats
path: root/whine.pl
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-02-26 21:57:37 +0100
committerDave Lawrence <dlawrence@mozilla.com>2013-02-26 21:57:37 +0100
commit5ccff95a61b0c0816fa42da061c298f794daf33d (patch)
tree2b46e295fb29bcd57afd6c8532001290d82ec953 /whine.pl
parent8555ab1f12abd53744d0cb4fe9b3d7a925b10194 (diff)
downloadbugzilla-5ccff95a61b0c0816fa42da061c298f794daf33d.tar.gz
bugzilla-5ccff95a61b0c0816fa42da061c298f794daf33d.tar.xz
Bug 836067 - backport bug 819432 to BMO 4.2 to improve search performance
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 ad6067228..e6161cfeb 100755
--- a/whine.pl
+++ b/whine.pl
@@ -453,7 +453,7 @@ sub run_queries {
'user' => $args->{'recipient'}, # the search runs as the recipient
);
# 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'}) {