Bugzilla – Attachment 93037 Details for
Bug 23624
Count rows in report without (potentially) consuming all memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23624: (QA follow-up) Don't fetch the count unless the query was successful
Bug-23624-QA-follow-up-Dont-fetch-the-count-unless.patch (text/plain), 925 bytes, created by
Liz Rea
on 2019-09-20 19:22:50 UTC
(
hide
)
Description:
Bug 23624: (QA follow-up) Don't fetch the count unless the query was successful
Filename:
MIME Type:
Creator:
Liz Rea
Created:
2019-09-20 19:22:50 UTC
Size:
925 bytes
patch
obsolete
>From 8ed89e1ade45ae4ee46b24626d02dcf683e472ea Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 20 Sep 2019 07:14:34 -0400 >Subject: [PATCH] Bug 23624: (QA follow-up) Don't fetch the count unless the > query was successful > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> >--- > C4/Reports/Guided.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm >index 58d78002e0..4ff311edb8 100644 >--- a/C4/Reports/Guided.pm >+++ b/C4/Reports/Guided.pm >@@ -424,12 +424,15 @@ sub nb_rows { > while ( $sql =~ m/$derived_name/ ) { > $derived_name .= 'x'; > } >+ > my $sth = C4::Context->dbh->prepare(qq{ > SELECT COUNT(*) FROM > ( $sql ) $derived_name > }); >+ > $sth->execute(); >- my $n = $sth->fetch->[0]; >+ my $results = $sth->fetch; >+ my $n = $results ? $results->[0] : 0; > > return $n; > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23624
:
92841
|
92903
|
92968
|
92969
|
92970
|
92974
|
92975
|
92976
|
92995
|
93037
|
93153
|
93154
|
93155
|
93156
|
93157