Bugzilla – Attachment 20614 Details for
Bug 10682
Inappropriate uses of finish() in C4::Reserve.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10682 : Inappropriate uses of finish() in C4::Reserves
Bug-10682--Inappropriate-uses-of-finish-in-C4Reser.patch (text/plain), 3.50 KB, created by
Bernardo Gonzalez Kriegel
on 2013-08-25 22:28:32 UTC
(
hide
)
Description:
Bug 10682 : Inappropriate uses of finish() in C4::Reserves
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2013-08-25 22:28:32 UTC
Size:
3.50 KB
patch
obsolete
>From c505fa3f3bdd6fabd3301afed63ad69c56638721 Mon Sep 17 00:00:00 2001 >From: Kenza Zaki <kenza.zaki@biblibre.com> >Date: Mon, 5 Aug 2013 11:50:40 +0200 >Subject: [PATCH] Bug 10682 : Inappropriate uses of finish() in C4::Reserves > >This patch gets rid of finish. > >From the man page > >finish() >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: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> >Comment: Similar to other patches from the same author >I run prove t/db_dependent/Reserves.t without errors >don't know if more tests are needed. >No koha-qa errors >--- > C4/Reserves.pm | 11 ----------- > 1 file changed, 11 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index d6812f1..c32e187 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -623,7 +623,6 @@ sub GetReserveFee { > my $sth = $dbh->prepare($query); > $sth->execute($borrowernumber); > my $data = $sth->fetchrow_hashref; >- $sth->finish(); > my $fee = $data->{'reservefee'}; > my $cntitems = @- > $bibitems; > >@@ -664,7 +663,6 @@ sub GetReserveFee { > } > } > } >- $sth1->finish; > my $cntitemsfound = @biblioitems; > my $issues = 0; > my $x = 0; >@@ -1007,7 +1005,6 @@ sub CancelReserve { > "; > my $sth = $dbh->prepare($query); > $sth->execute( $reserve_id ); >- $sth->finish; > > $query = " > INSERT INTO old_reserves >@@ -1090,7 +1087,6 @@ sub ModReserve { > "; > my $sth = $dbh->prepare($query); > $sth->execute( $reserve_id ); >- $sth->finish; > $query = " > INSERT INTO old_reserves > SELECT * >@@ -1114,7 +1110,6 @@ sub ModReserve { > "; > my $sth = $dbh->prepare($query); > $sth->execute( $rank, $branchcode, $itemnumber, $reserve_id ); >- $sth->finish; > > if ( defined( $suspend_until ) ) { > if ( $suspend_until ) { >@@ -1160,7 +1155,6 @@ sub ModReserveFill { > my $sth = $dbh->prepare($query); > $sth->execute( $biblionumber, $borrowernumber, $resdate ); > ($priority) = $sth->fetchrow_array; >- $sth->finish; > > # update the database... > $query = "UPDATE reserves >@@ -1172,7 +1166,6 @@ sub ModReserveFill { > "; > $sth = $dbh->prepare($query); > $sth->execute( $biblionumber, $resdate, $borrowernumber ); >- $sth->finish; > > # move to old_reserves > $query = "INSERT INTO old_reserves >@@ -1514,7 +1507,6 @@ sub ToggleLowestPriority { > > my $sth = $dbh->prepare( "UPDATE reserves SET lowestPriority = NOT lowestPriority WHERE reserve_id = ?"); > $sth->execute( $reserve_id ); >- $sth->finish; > > _FixPriority( $reserve_id, '999999' ); > } >@@ -1549,7 +1541,6 @@ sub ToggleSuspend { > push( @params, $reserve_id ); > > $sth->execute( @params ); >- $sth->finish; > } > > =head2 SuspendAll >@@ -1605,7 +1596,6 @@ sub SuspendAll { > $dbh = C4::Context->dbh; > $sth = $dbh->prepare( $query ); > $sth->execute( @query_params ); >- $sth->finish; > } > > >@@ -1689,7 +1679,6 @@ sub _FixPriority { > $j + 1, > $priority[$j]->{'reserve_id'} > ); >- $sth->finish; > } > > $sth = $dbh->prepare( "SELECT reserve_id FROM reserves WHERE lowestPriority = 1 ORDER BY priority" ); >-- >1.7.9.5
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 10682
:
20108
|
20614
|
20646