Bugzilla – Attachment 26637 Details for
Bug 7567
News by Library: refactor, enhance, and fix
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7567 - Removed finish calls
Bug-7567---Removed-finish-calls.patch (text/plain), 2.52 KB, created by
Jonathan Druart
on 2014-03-27 12:25:29 UTC
(
hide
)
Description:
Bug 7567 - Removed finish calls
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-27 12:25:29 UTC
Size:
2.52 KB
patch
obsolete
>From 29ea7f9c042620c7083ce5e0405f65e50c0528fb Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sun, 15 Dec 2013 22:33:32 -0500 >Subject: [PATCH] Bug 7567 - Removed finish calls > >"When all the data has been fetched from a SELECT statement, >the driver will automatically call finish for you. So you should >not call it explicitly except when you know that you've not >fetched all the data from a statement handle and the handle >won't be destroyed soon." >(http://search.cpan.org/~timb/DBI-1.627/DBI.pm#finish) > >All the $sth variables were scoped within the functions, >and would be destroyed immediately. Additionally, there was >one after a SELECT, for only a single idnew, and so it was >not necessary. > >TEST PLAN >--------- >1) prove -v t/db_dependent/NewsChannels.t >2) apply patch >3) prove -v t/db_dependent/NewsChannels.t > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> > >ok 1 - use C4::NewsChannels; >ok 2 - Successfully added the first dummy news item! >ok 3 - Successfully added the second dummy news item! >ok 4 - Successfully updated second dummy news item! >ok 5 - Successfully tested get_opac_new id1! >ok 6 - Successfully tested get_opac_new id2! >ok 7 - Successfully tested get_opac_news! >ok 8 - Successfully tested GetNewsToDisplay! > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > C4/NewsChannels.pm | 4 ---- > 1 file changed, 4 deletions(-) > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index 3982935..cc931d2 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -51,7 +51,6 @@ sub add_opac_new { > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare("INSERT INTO opac_news (title, new, lang, expirationdate, timestamp, number) VALUES (?,?,?,?,?,?)"); > $sth->execute($title, $new, $lang, $expirationdate, $timestamp, $number); >- $sth->finish; > return 1; > } > >@@ -69,7 +68,6 @@ sub upd_opac_new { > WHERE idnew = ? > "); > $sth->execute($title, $new, $lang, $expirationdate, $timestamp,$number,$idnew); >- $sth->finish; > return 1; > } > >@@ -79,7 +77,6 @@ sub del_opac_new { > my $dbh = C4::Context->dbh; > my $sth = $dbh->prepare("DELETE FROM opac_news WHERE idnew IN ($ids)"); > $sth->execute(); >- $sth->finish; > return 1; > } else { > return 0; >@@ -95,7 +92,6 @@ sub get_opac_new { > $data->{$data->{'lang'}} = 1 if defined $data->{lang}; > $data->{expirationdate} = format_date($data->{expirationdate}); > $data->{timestamp} = format_date($data->{timestamp}); >- $sth->finish; > return $data; > } > >-- >1.7.10.4
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 7567
:
22863
|
22917
|
22920
|
23350
|
23351
|
23352
|
23362
|
23368
|
23378
|
23383
|
23386
|
23474
|
23475
|
23501
|
23544
|
23547
|
23552
|
23553
|
23554
|
23559
|
23664
|
23703
|
23704
|
23705
|
25316
|
25317
|
25318
|
25319
|
25320
|
25321
|
25322
|
25323
|
25324
|
25325
|
25331
|
25332
|
25333
|
26510
|
26511
|
26590
|
26591
|
26592
|
26593
|
26594
|
26595
|
26596
|
26597
|
26598
|
26599
|
26600
|
26601
|
26602
|
26603
|
26604
|
26605
|
26606
|
26607
|
26608
|
26609
|
26610
|
26611
|
26612
|
26631
|
26632
|
26633
|
26634
|
26635
|
26636
| 26637 |
26638
|
26639
|
26640
|
26641
|
26642
|
26643
|
26644
|
26647