We detected a bug that is known since 2003.
The value of an auto increment column is set back to zero when you are having an empty table and restarting the MySQL DBMS. We run into this issue by using the auto increment value as a history id into a second table.
How can you work around this issue?
The easiest way is to order by id descending on the second table or to setup a "start up" shell script that calculates and sets the auto increment value.
The author does not allow comments to this entry