title: MySQL duplicate ID
body: <p>Could it somehow happen that MySQL generates the same autoincrement ID twice?</p>
  
  <p>We have the following situation:</p>
  
  <ol>
  <li><p>a bill with id=100 was created;</p></li>
  <li><p>then it was deleted;</p></li>
  <li><p>then another bill was created and it has the same id = 100;</p></li>
  </ol>
  
  <p>The structure of the table is:</p>
  
  <pre><code>CREATE TABLE `bill` (
    `id` int(11) NOT NULL auto_increment,
    `user` int(11) NOT NULL,
    `date` datetime NOT NULL,
    `state` int(11) NOT NULL,
    `adv` bit(1) NOT NULL default b'0',
    `weight` int(11) default NULL,
    PRIMARY KEY  (`id`),
    KEY `FK2E2407EC768806` (`user`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
  
  ALTER TABLE `bill`
    ADD CONSTRAINT `FK2E2407EC768806` FOREIGN KEY (`user`) REFERENCES `user` (`id`);
  </code></pre>
  
  <p>Could there be some race condition or does MySQL guarantee unique autoincrement ids?</p>
  
  <p>UPDATE: we cannot reproduce this situation but we logged it.</p>