Today I was asked to look into this problem and I have never seen anything like this before. A table in our MySQL database, with a primary IDs column, which is set to autoincrement int, had some weird IDs. So the sequence goes as follows:
Some more random ids
You can see between 27243 and 27245, and 27324 and 27325 there are some different numbers inserted. This has caused a lot of problem for us since there are FK in another table which are now missing or messed up. Even today, there was one similar incidence.
In my many years of dealing with MySQL, this is the first time ever I am seeing something like this. What could have been the reason and how to correct it?
There are no triggers. Currently table create statement shows:
CREATE TABLE `txn` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `client_id` int(11) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=27368 DEFAULT CHARSET=latin1;