Bugzilla – Attachment 20108 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.27 KB, created by
kenza
on 2013-08-05 09:53:14 UTC
(
hide
)
Description:
Bug 10682 : Inappropriate uses of finish() in C4::Reserves
Filename:
MIME Type:
Creator:
kenza
Created:
2013-08-05 09:53:14 UTC
Size:
3.27 KB
patch
obsolete
>From be5f6c19ecd278f9b34679e2b21543f5ac4f8c94 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. >--- > C4/Reserves.pm | 11 ----------- > 1 file changed, 11 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 1f89127..d340759 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -611,7 +611,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; > >@@ -652,7 +651,6 @@ sub GetReserveFee { > } > } > } >- $sth1->finish; > my $cntitemsfound = @biblioitems; > my $issues = 0; > my $x = 0; >@@ -995,7 +993,6 @@ sub CancelReserve { > "; > my $sth = $dbh->prepare($query); > $sth->execute( $reserve_id ); >- $sth->finish; > > $query = " > INSERT INTO old_reserves >@@ -1078,7 +1075,6 @@ sub ModReserve { > "; > my $sth = $dbh->prepare($query); > $sth->execute( $reserve_id ); >- $sth->finish; > $query = " > INSERT INTO old_reserves > SELECT * >@@ -1102,7 +1098,6 @@ sub ModReserve { > "; > my $sth = $dbh->prepare($query); > $sth->execute( $rank, $branchcode, $itemnumber, $reserve_id ); >- $sth->finish; > > if ( defined( $suspend_until ) ) { > if ( $suspend_until ) { >@@ -1148,7 +1143,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 >@@ -1160,7 +1154,6 @@ sub ModReserveFill { > "; > $sth = $dbh->prepare($query); > $sth->execute( $biblionumber, $resdate, $borrowernumber ); >- $sth->finish; > > # move to old_reserves > $query = "INSERT INTO old_reserves >@@ -1502,7 +1495,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' ); > } >@@ -1537,7 +1529,6 @@ sub ToggleSuspend { > push( @params, $reserve_id ); > > $sth->execute( @params ); >- $sth->finish; > } > > =head2 SuspendAll >@@ -1593,7 +1584,6 @@ sub SuspendAll { > $dbh = C4::Context->dbh; > $sth = $dbh->prepare( $query ); > $sth->execute( @query_params ); >- $sth->finish; > } > > >@@ -1677,7 +1667,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