Bugzilla – Attachment 65710 Details for
Bug 19016
Add a script to fix corrupted data
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19016: Check and fix 'biblioitems'
Bug-19016-Check-and-fix-biblioitems.patch (text/plain), 2.22 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-08-09 13:28:01 UTC
(
hide
)
Description:
Bug 19016: Check and fix 'biblioitems'
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-08-09 13:28:01 UTC
Size:
2.22 KB
patch
obsolete
>From f687c419cf342dc0e50bc620f0f3f0ef12e5d38b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 9 Aug 2017 10:03:09 -0300 >Subject: [PATCH] Bug 19016: Check and fix 'biblioitems' > >This patch adds 'biblioitems' to the list of tables to be evaluated and fixed. > >To test the problem exists: >- reset_all >- Run: > $ sudo koha-mysql kohadev > > SELECT biblionumber FROM biblio ORDER BY biblionumber DESC LIMIT 1; >- From the staff UI, delete the biblio with that biblionumber >- Restart mysql: > $ sudo systemctl restart mysql.service >- Add a new biblio record >- Run: > $ sudo koha-shell kohadev > k> cd kohaclone > k> misc/cronjobs/cleanup_database.pl --list-corrupted-data >=> FAIL: biblioitems issue is not higlighted >- Apply this patch >- Run: > $ sudo koha-shell kohadev > k> cd kohaclone > k> misc/cronjobs/cleanup_database.pl --list-corrupted-data >=> SUCCESS: biblioitems issue is highlighted > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > misc/cronjobs/cleanup_database.pl | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl >index b1967b6..54ffcf2 100755 >--- a/misc/cronjobs/cleanup_database.pl >+++ b/misc/cronjobs/cleanup_database.pl >@@ -561,6 +561,10 @@ sub GetCorruptedData { > q|SELECT b.biblionumber FROM biblio b JOIN deletedbiblio db ON b.biblionumber=db.biblionumber|, > { Slice => {} } > ); >+ my $biblioitems = $dbh->selectall_arrayref( >+ q|SELECT b.biblioitemnumber FROM biblioitems b JOIN deletedbiblioitems db ON b.biblioitemnumber=db.biblioitemnumber|, >+ { Slice => {} } >+ ); > my $items = $dbh->selectall_arrayref( > q|SELECT i.itemnumber FROM items i JOIN deleteditems di ON i.itemnumber=di.itemnumber|, > { Slice => {} } >@@ -590,6 +594,11 @@ sub GetCorruptedData { > : () > ), > ( >+ @$biblioitems >+ ? { entity => 'biblioitems', col_name => 'biblioitemnumber', rows => $biblioitems, tables => ['biblioitems', 'deletedbiblioitems'] } >+ : () >+ ), >+ ( > @$items ? { entity => 'items', col_name => 'itemnumber', rows => $items, tables => [ 'items', 'deleteditems' ] } > : () > ), >-- >2.7.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 19016
:
65402
|
65403
|
65456
| 65710 |
68015