[Koha-bugs] [Bug 19016] Add a script to fix corrupted data

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Sep 12 15:12:03 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19016

--- Comment #13 from Jonathan Druart <jonathan.druart at bugs.koha-community.org> ---
(In reply to dguidry from comment #12)
> (In reply to Christian McDonald from comment #11)
> > When can expect a fix to be available via the stable Debian repo? I have 120
> > affected rows in my issues tables that is preventing my library from
> > properly returning books. Otherwise, how can I manually fix "deal with"
> > these affected rows?
> 
> Seconded. I've applied the fix (DBMS auto increment fix on the Koha wiki
> site) to prevent further occurrences, but this doesn't appear to fix
> existing corruption. We have a handful of books that we're unable to check
> back in. How would one go about fixing this manually in lieu of the upcoming
> script?

For issues/old_issues you could try the script, in a test environment(!)
You will see this kind of output:

  Updating issues.issue_id=24 with new id 42

When it is done, you should double-check the accountlines rows with the
issue_id values that have been updated:

  SELECT borrowernumber FROM accountlines WHERE issue_id=42;

There are 2 possibilities: either the accountlines has been correctly updated,
or not. Either fines has been attached to the correct patron account, or
another patron has been charged (!)

The accountlines values have been updated with the following line of the
cleanup script:
511 $dbh->do( q|UPDATE accountlines SET issue_id = ? WHERE issue_id = ?|,
undef, $max, $old_id );
If you do not want accountlines to be updated, you can comment this line and
execute the script again on a DB backup.

Without feedback I cannot tell you if it is preferable to comment this line or
not.
By instinct I would comment the line and assume that check-ins are certainly 
related to a fine rather than already checked out items.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list