Bugzilla – Attachment 19948 Details for
Bug 10643
Inappropriate uses of $sth->finish() in C4::ClassSource.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10643: Inappropriate uses of $sth->finish() in C4::ClassSource.pm
Bug-10643-Inappropriate-uses-of-sth-finish-in-C4Cl.patch (text/plain), 3.48 KB, created by
kenza
on 2013-07-25 12:06:55 UTC
(
hide
)
Description:
Bug 10643: Inappropriate uses of $sth->finish() in C4::ClassSource.pm
Filename:
MIME Type:
Creator:
kenza
Created:
2013-07-25 12:06:55 UTC
Size:
3.48 KB
patch
obsolete
>From 3c129dd6af9b3f5e02b42674b743dfb37bed4f3c Mon Sep 17 00:00:00 2001 >From: root <root@kenza-VirtualBox> >Date: Thu, 25 Jul 2013 14:03:32 +0200 >Subject: [PATCH] Bug 10643: Inappropriate uses of $sth->finish() in > C4::ClassSource.pm > >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/ClassSource.pm | 11 ----------- > 1 file changed, 11 deletions(-) > >diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm >index 63f6c67..3f9c1d0 100644 >--- a/C4/ClassSource.pm >+++ b/C4/ClassSource.pm >@@ -98,7 +98,6 @@ sub GetClassSources { > while (my $source = $sth->fetchrow_hashref) { > $class_sources{ $source->{'cn_source'} } = $source; > } >- $sth->finish(); > > return \%class_sources; > >@@ -120,7 +119,6 @@ sub AddClassSource { > (`cn_source`, `description`, `used`, `class_sort_rule`) > VALUES (?, ?, ?, ?)"); > $sth->execute($cn_source, $description, $used, $class_sort_rule); >- $sth->finish(); > > } > >@@ -139,7 +137,6 @@ sub GetClassSource { > my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources` WHERE cn_source = ?"); > $sth->execute($cn_source); > my $row = $sth->fetchrow_hashref(); >- $sth->finish(); > return $row; > } > >@@ -161,7 +158,6 @@ sub ModClassSource { > `class_sort_rule` = ? > WHERE `cn_source` = ?"); > $sth->execute($description, $used, $class_sort_rule, $cn_source); >- $sth->finish(); > > } > >@@ -179,7 +175,6 @@ sub DelClassSource { > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare_cached("DELETE FROM `class_sources` WHERE `cn_source` = ?"); > $sth->execute($cn_source); >- $sth->finish(); > > } > >@@ -215,7 +210,6 @@ sub GetClassSortRules { > while (my $sort_rule = $sth->fetchrow_hashref) { > $class_sort_rules{ $sort_rule->{'class_sort_rule'} } = $sort_rule; > } >- $sth->finish(); > > return \%class_sort_rules; > >@@ -237,7 +231,6 @@ sub AddClassSortRule { > (`class_sort_rule`, `description`, `sort_routine`) > VALUES (?, ?, ?)"); > $sth->execute($class_sort_rule, $description, $sort_routine); >- $sth->finish(); > > } > >@@ -256,7 +249,6 @@ sub GetClassSortRule { > my $sth = $dbh->prepare_cached("SELECT * FROM `class_sort_rules` WHERE `class_sort_rule` = ?"); > $sth->execute($class_sort_rule); > my $row = $sth->fetchrow_hashref(); >- $sth->finish(); > return $row; > } > >@@ -277,7 +269,6 @@ sub ModClassSortRule { > `sort_routine` = ? > WHERE `class_sort_rule` = ?"); > $sth->execute($description, $sort_routine, $class_sort_rule); >- $sth->finish(); > > } > >@@ -295,7 +286,6 @@ sub DelClassSortRule { > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare_cached("DELETE FROM `class_sort_rules` WHERE `class_sort_rule` = ?"); > $sth->execute($class_sort_rule); >- $sth->finish(); > > } > >@@ -319,7 +309,6 @@ sub GetSourcesForSortRule { > while (my ($source) = $sth->fetchrow_array()) { > push @sources, $source; > } >- $sth->finish(); > return @sources; > > } >-- >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 10643
:
19948
|
20105
|
20120
|
20236