diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-02-27 15:55:50 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-02-27 15:55:50 +0100 |
commit | 0c6d95615195a455b9c4bfc0242a7690f5a881ab (patch) | |
tree | 281e7a8d7a802fdf0c88de8dd7e9d14b7ba44dec /whine.pl | |
parent | d388c8203d3fb1f2f97569dd9dbdffcd5acc8aa2 (diff) | |
download | bugzilla-0c6d95615195a455b9c4bfc0242a7690f5a881ab.tar.gz bugzilla-0c6d95615195a455b9c4bfc0242a7690f5a881ab.tar.xz |
Bug 836067 - backport bug 819432 to BMO 4.2 to improve search performance
Diffstat (limited to 'whine.pl')
-rwxr-xr-x | whine.pl | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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'}) { |