Bugzilla – Attachment 64495 Details for
Bug 18651
Move of checkouts is still not correctly handled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18651: Do no LOCK/UNLOCK the table
Bug-18651-Do-no-LOCKUNLOCK-the-table.patch (text/plain), 2.16 KB, created by
Jonathan Druart
on 2017-06-21 17:16:52 UTC
(
hide
)
Description:
Bug 18651: Do no LOCK/UNLOCK the table
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-06-21 17:16:52 UTC
Size:
2.16 KB
patch
obsolete
>From 905572910b3af03d86fdbd3e52c72614f41c978b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 21 Jun 2017 14:14:09 -0300 >Subject: [PATCH] Bug 18651: Do no LOCK/UNLOCK the table > >We cannot LOCK the old_issues table here, other tables are accessed and DBIx::Class rename it with "me": >DBD::mysql::st execute failed: Table 'me' was not locked with LOCK >TABLES [for Statement "SELECT `me`.`issue_id`, `me`.`borrowernumber`, >`me`.`itemnumber`, `me`.`date_due`, `me`.`branchcode`, >`me`.`returndate`, `me`.`lastreneweddate`, `me`.`renewals`, >`me`.`auto_renew`, `me`.`auto_renew_error`, `me`.`timestamp`, >`me`.`issuedate`, `me`.`onsite_checkout`, `me`.`note`, `me`.`notedate` >FROM `old_issues` `me` WHERE ( `me`.`issue_id` = ? )" with ParamValues: >0='2'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. > >Consequence: We could have a checkin refused if there is a race, but >this is the simplest and safest way to fix it. >--- > C4/Circulation.pm | 6 ------ > 1 file changed, 6 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index e25167d5c5..1cfa69b2d2 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2172,14 +2172,10 @@ sub MarkIssueReturned { > push @bind, $issue_id; > > # FIXME Improve the return value and handle it from callers >- my $do_not_lock = ( exists $ENV{_} && $ENV{_} =~ m|prove| ) || $ENV{KOHA_NO_TABLE_LOCKS}; > $schema->txn_do(sub { > > $dbh->do( $query, undef, @bind ); > >- C4::Context->dbh->do(q|LOCK TABLE old_issues READ|) unless $do_not_lock; >- C4::Context->dbh->do(q|LOCK TABLE old_issues WRITE|) unless $do_not_lock; >- > my $issue = Koha::Checkouts->find( $issue_id ); # FIXME should be fetched earlier > > # Create the old_issues entry >@@ -2196,8 +2192,6 @@ sub MarkIssueReturned { > $old_checkout_data->{issue_id} = $issue_id; > my $old_checkout = Koha::Old::Checkout->new($old_checkout_data)->store; > >- C4::Context->dbh->do(q|UNLOCK TABLES|) unless $do_not_lock; >- > # Update the fines > $dbh->do(q|UPDATE accountlines SET issue_id = ? WHERE issue_id = ?|, undef, $old_checkout->issue_id, $issue->issue_id); > >-- >2.11.0
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 18651
:
63629
|
63630
|
63631
|
63632
|
63633
|
63634
|
63635
|
63636
|
63637
|
63654
|
63659
|
63706
|
64352
|
64353
|
64354
|
64355
|
64356
|
64357
|
64394
|
64395
|
64396
|
64397
|
64398
|
64399
|
64448
|
64449
|
64450
|
64451
|
64452
|
64453
|
64454
|
64455
|
64489
|
64490
| 64495 |
65134