Bug 10629 - Inappropriate uses of $sth->finish() in C4::Branch.pm
Summary: Inappropriate uses of $sth->finish() in C4::Branch.pm
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: kenza
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 10508
  Show dependency treegraph
 
Reported: 2013-07-23 13:14 UTC by kenza
Modified: 2014-12-07 20:03 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Inappropriate uses of $sth->finish() in C4::Branch.pm (3.19 KB, patch)
2013-07-23 13:33 UTC, kenza
Details | Diff | Splinter Review
Bug 10629 : Inappropriate uses of $sth->finish() in C4::Branch.pm (3.55 KB, patch)
2013-07-24 05:55 UTC, Chris Cormack
Details | Diff | Splinter Review
Bug 10629 : Inappropriate uses of $sth->finish() in C4::Branch.pm (3.62 KB, patch)
2013-08-09 15:19 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description kenza 2013-07-23 13:14:02 UTC

    
Comment 1 kenza 2013-07-23 13:33:12 UTC Comment hidden (obsolete)
Comment 2 Chris Cormack 2013-07-24 05:55:56 UTC Comment hidden (obsolete)
Comment 3 Chris Cormack 2013-07-24 05:57:25 UTC
Signed off, Kenza please don't forget to add the Bug number to your commit message, but otherwise this was a great patch
Comment 4 Kyle M Hall 2013-08-09 15:19:39 UTC
Created attachment 20237 [details] [review]
Bug 10629 : Inappropriate uses of $sth->finish() in C4::Branch.pm

Test plan :
Check if the regression tests still works
prove t/db_dependent/Branch.t
t/db_dependent/Branch.t .. 1/36 Using a hash as a reference is deprecated at t/db_dependent/Branch.t line 207.
t/db_dependent/Branch.t .. ok
All tests successful.
Files=1, Tests=36,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.12 cusr  0.00 csys =  0.16 CPU)
Result: PASS

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

From the man page

finsh()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.

Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Galen Charlton 2013-08-28 14:26:54 UTC
Pushed to master.  Thanks, Kenza!
Comment 6 Tomás Cohen Arazi 2013-09-13 17:25:22 UTC
This patch has been pushed to 3.12.x, will be in 3.12.5.

Thanks Kenza!