Bugzilla – Attachment 57152 Details for
Bug 17539
t/db_dependent/Reserves.t is failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17539: Fix Already in a transaction error
Bug-17539-Fix-Already-in-a-transaction-error.patch (text/plain), 2.23 KB, created by
Marcel de Rooy
on 2016-11-04 08:04:01 UTC
(
hide
)
Description:
Bug 17539: Fix Already in a transaction error
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-11-04 08:04:01 UTC
Size:
2.23 KB
patch
obsolete
>From 882942f8541bb476f627bc9b02d993ad4c451b38 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Wed, 2 Nov 2016 15:05:28 +0200 >Subject: [PATCH] Bug 17539: Fix Already in a transaction error >Content-Type: text/plain; charset=utf-8 > >perl t/db_dependent/Reserves.t > >1..72 >ok 1 - use C4::Reserves; >ok 2 - CheckReserves Test 1 >... >ok 52 - Reserve in waiting status cant be canceled >ok 53 - Reserving an ageRestricted Biblio without a borrower dateofbirth succeeds >DBD::mysql::db begin_work failed: Already in a transaction at >/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. >DBD::mysql::db begin_work failed: Already in a transaction at >/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1489. >at /usr/share/perl5/DBIx/Class/Schema.pm line 1080. >... >Koha::Object::store('Koha::Patron=HASH(0x9e43b20)') called at >/home/ubuntu/kohaclone/C4/Members.pm line 542 >C4::Members::ModMember('borrowernumber', 658535, 'dateofbirth', '2001-11-02') >called at t/db_dependent/Reserves.t line 516 > >This patch fixes this issue by replacing dbh autocommit=0 with >txn_begin. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/Reserves.t | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index 1e9a067..442c180 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -50,8 +50,9 @@ $module->mock('userenv', sub { > my $dbh = C4::Context->dbh; > > # Start transaction >-$dbh->{AutoCommit} = 0; >-$dbh->{RaiseError} = 1; >+my $database = Koha::Database->new(); >+my $schema = $database->schema(); >+$schema->storage->txn_begin(); > > # Somewhat arbitrary field chosen for age restriction unit tests. Must be added to db before the framework is cached > $dbh->do("update marc_subfield_structure set kohafield='biblioitems.agerestriction' where tagfield='521' and tagsubfield='a'"); >@@ -678,7 +679,7 @@ is( $status, 'Reserved', 'MoveReserve did not fill future hold of 3 days'); > $dbh->do('DELETE FROM reserves', undef, ($bibnum)); > > # we reached the finish >-$dbh->rollback; >+$schema->storage->txn_rollback(); > > sub count_hold_print_messages { > my $message_count = $dbh->selectall_arrayref(q{ >-- >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 17539
:
57094
|
57095
|
57096
|
57127
|
57128
|
57129
|
57134
|
57135
|
57136
|
57137
|
57151
| 57152 |
57153
|
57154
|
57155