[Ur] MySQL+InnoDB-backed sequences reset on database restart

Istvan Chung istvan at vivatropolis.org
Tue Jun 11 23:23:20 EDT 2013


Hello,

It appears that when using MySQL with InnoDB, the AUTO_INCREMENT counter
which Ur/Web uses to maintain sequences is reset when the database is
restarted. This is because of a [bug in
InnoDB](http://bugs.mysql.com/bug.php?id=199). In essence, whenever the
database is restarted, InnoDB determines where the counter was left off
by finding the first available number in each table which uses
AUTO_INCREMENT, and uses that as the new initial value for the counter.

However, since Ur/Web erases each entry in the table used to maintain
the sequence as soon as it is done using that entry, InnoDB doesn't know
which numbers have been used, and starts over at 1. Although this is a
bug in InnoDB, it might be considered to simply remove (if only for
MySQL+InnoDB) the behavior of erasing each entry as it is used, so that
InnoDB can continue the AUTO_INCREMENT counter correctly.

-- 
Istvan Chung



More information about the Ur mailing list