Bugzilla – Attachment 141595 Details for
Bug 31727
Orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31727: Orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing
Bug-31727-Orphan-records-in-circulationrules-and-f.patch (text/plain), 2.42 KB, created by
Kevin Carnes
on 2022-10-11 07:25:45 UTC
(
hide
)
Description:
Bug 31727: Orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing
Filename:
MIME Type:
Creator:
Kevin Carnes
Created:
2022-10-11 07:25:45 UTC
Size:
2.42 KB
patch
obsolete
>From fd705d123296c4a363364870bff55e8d33316deb Mon Sep 17 00:00:00 2001 >From: Kevin Carnes <kevin.carnes@ub.lu.se> >Date: Tue, 11 Oct 2022 09:24:40 +0200 >Subject: [PATCH] Bug 31727: Orphan records in circulation_rules and false > positives after attempt to fix values to be empty or zeroes instead of > missing > >--- > .../data/mysql/atomicupdate/bug_31727.pl | 29 +++++++++++++++++++ > 1 file changed, 29 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_31727.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_31727.pl b/installer/data/mysql/atomicupdate/bug_31727.pl >new file mode 100755 >index 0000000000..375116ea73 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_31727.pl >@@ -0,0 +1,29 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "31727", >+ description => "Orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ for my $rule_name ( qw( issuelength hardduedate unseenrenewalsallowed rentaldiscount decreaseloanholds ) ) { >+ $dbh->do(q{ >+ DELETE FROM circulation_rules WHERE id in ( >+ SELECT id FROM ( >+ SELECT id FROM circulation_rules cr WHERE rule_name = ? AND NOT EXISTS ( >+ SELECT NULL FROM circulation_rules cr2 >+ WHERE >+ cr2.rule_name="suspension_chargeperiod" >+ AND ( (cr2.branchcode=cr.branchcode) OR ( ISNULL(cr2.branchcode) AND ISNULL(cr.branchcode) ) ) >+ AND ( (cr2.categorycode=cr.categorycode) OR ( ISNULL(cr2.categorycode) AND ISNULL(cr.categorycode) ) ) >+ AND ( (cr2.itemtype=cr.itemtype) OR ( ISNULL(cr2.itemtype) AND ISNULL(cr.itemtype) ) ) >+ ) >+ ) AS ids >+ ) >+ }, undef, $rule_name); >+ } >+ say $out "Removed orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing"; >+ $dbh->do(q{UPDATE circulation_rules SET rule_name = "unseen_renewals_allowed" WHERE rule_name = "unseenrenewalsallowed"}); >+ say $out "Renamed unseenrenewalsallowed to unseen_renewals_allowed in circulation_rules"; >+ }, >+} >-- >2.25.1
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 31727
:
141595
|
141600
|
141601
|
141618
|
141725