<p dir="ltr">Is there some sort of pragma or option we could set on the database or table to prevent this autooptimization? </p>
<br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 4, 2016, 18:20 David Cook <<a href="mailto:dcook@prosentient.com.au">dcook@prosentient.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Glad to see someone else looking at this bug. We had this happen just the<br>
other day.<br>
<br>
Mark, I think the reset of auto_increment also happens after OPTIMIZE TABLE,<br>
if I recall correctly. Very annoying...<br>
<br>
Owen, you create a new entry in issues which gets an auto_id of 500. That<br>
bumps up the auto_increment to 501. However, if you move that entry into<br>
old_issues - with an id of 500 - then restart the MySQL server (it seems) or<br>
run OPTIMIZE TABLE issues, the auto_increment for issues is reset to 500.<br>
You try to check in that check out, and you get a software error, because<br>
there's already an entry with a primary key of 500 in the old_issues table.<br>
<br>
Not only is there a loss of history, but I'm pretty sure that newer issue<br>
stays in the issues table, because it can't be moved, and that'll likely<br>
have all sorts of flow on effects.<br>
<br>
Fun times!<br>
<br>
I noticed this happening for reserves as well last year or the year before I<br>
think. We've tried to mitigate it locally, since I don't really see a way of<br>
fixing this issue with the current Koha methodology of using<br>
deletedtables...<br>
<br>
David Cook<br>
Systems Librarian<br>
Prosentient Systems<br>
72/330 Wattle St<br>
Ultimo, NSW 2007<br>
Australia<br>
<br>
Office: 02 9212 0899<br>
Direct: 02 8005 0595<br>
<br>
<br>
> -----Original Message-----<br>
> From: <a href="mailto:koha-devel-bounces@lists.koha-community.org" target="_blank">koha-devel-bounces@lists.koha-community.org</a> [mailto:<a href="mailto:koha-devel-" target="_blank">koha-devel-</a><br>
> <a href="mailto:bounces@lists.koha-community.org" target="_blank">bounces@lists.koha-community.org</a>] On Behalf Of Mark Tompsett<br>
> Sent: Wednesday, 31 August 2016 11:42 PM<br>
> To: Owen Leonard <<a href="mailto:oleonard@myacpl.org" target="_blank">oleonard@myacpl.org</a>><br>
> Cc: Koha-devel <<a href="mailto:koha-devel@lists.koha-community.org" target="_blank">koha-devel@lists.koha-community.org</a>><br>
> Subject: Re: [Koha-devel] Serious problem<br>
><br>
> Greetings,<br>
><br>
> >> check out, check in, restart mysql server, check out, check in...<br>
> >> old_issues bug!<br>
><br>
> > What exactly is the bug?<br>
><br>
> Loss of history.<br>
> Unless you do this after the server restart:<br>
> use koha_library;<br>
> insert into issues (borrowernumber) values (1);<br>
> -- this will fill the gap, and should restore it.<br>
> actually, whatever the mysql is to set the auto_increment to<br>
> max(issue_id)+1 from old_issues would work too.<br>
><br>
> GPML,<br>
> Mark Tompsett<br>
><br>
> _______________________________________________<br>
> Koha-devel mailing list<br>
> <a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
> <a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
> website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a> git : <a href="http://git.koha-" rel="noreferrer" target="_blank">http://git.koha-</a><br>
> <a href="http://community.org/" rel="noreferrer" target="_blank">community.org/</a> bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
<br>
<br>
_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
</blockquote></div>