1

I have an unique index in field mysql. My table is the follow:

Id INT(11)(AUTOINCREMENT)
login (VARCHAR) (UNIQUE)

If I do :

INSERT (login) VALUES ('test');//ok, the Id field equal 1
INSERT (login) VALUES ('test');//error, login field is unique
INSERT (login) VALUES ('test1');//ok, but Id field is 3

Why it jump the Id 2??

Fabio
  • 141
  • 4
  • 13
  • this is a repeated question of http://stackoverflow.com/questions/2787910/why-does-mysql-autoincrement-increase-on-failed-inserts, you'll probably find your answer there. – Churk Mar 28 '12 at 00:11

0 Answers0