<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="ltr">
<div dir="ltr">
<div style="FONT-SIZE: 12pt; FONT-FAMILY: 'Calibri'; COLOR: #000000">
<div>Greetings,</div>
<div> </div>
<div>I just hacked around it?</div>
<div><a title="https://github.com/mtompset/scripts/blob/master/innodb_hack.pl" href="https://github.com/mtompset/scripts/blob/master/innodb_hack.pl">https://github.com/mtompset/scripts/blob/master/innodb_hack.pl</a></div>
<div>Yes, it’s hard coded and ugly, but it is semi-functional.</div>
<div>And surely, there is a better way. Which is why I brought this issue up. <img class="wlEmoticon wlEmoticon-smile" style="BORDER-TOP-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-BOTTOM-STYLE: none; BORDER-RIGHT-STYLE: none" alt="Smile" src="cid:F325EEFD81F247FE9BA692400B649225@archangel"></div>
<div>
<div style="FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline">
</div>
</div>
<div>
<div style="FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline">
GPML,</div>
</div>
<div>
<div style="FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline">
Mark Tompsett</div>
</div>
<div>
<div style="FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline">
 </div>
</div>
<div>
<div style="FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline">
</div>
<div style="FONT: 10pt tahoma">
<div style="BACKGROUND: #f5f5f5">
<div style="font-color: black"><b>From:</b> <a title="pianohacker@gmail.com" href="mailto:pianohacker@gmail.com">
Jesse</a> </div>
<div><b>Sent:</b> Monday, September 05, 2016 4:15 PM</div>
<div><b>To:</b> <a title="dcook@prosentient.com.au" href="mailto:dcook@prosentient.com.au">
David Cook</a> ; <a title="mtompset@hotmail.com" href="mailto:mtompset@hotmail.com">
Mark Tompsett</a> ; <a title="oleonard@myacpl.org" href="mailto:oleonard@myacpl.org">
Owen Leonard</a> </div>
<div><b>Cc:</b> <a title="koha-devel@lists.koha-community.org" href="mailto:koha-devel@lists.koha-community.org">
Koha-devel</a> </div>
<div><b>Subject:</b> Re: [Koha-devel] Serious problem</div>
</div>
</div>
<div> </div>
</div>
<div style="FONT-SIZE: small; TEXT-DECORATION: none; FONT-FAMILY: "Calibri"; FONT-WEIGHT: normal; COLOR: #000000; FONT-STYLE: normal; DISPLAY: inline">
<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="PADDING-LEFT: 1ex; BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex">
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>
</div>
</div>
</div>
</body>
</html>