i had the same problem with myisam tables where some started to produce duplicate entries
on the auto increment field at random values.
to be more specific:
show table status like "mytable";
auto_increment: 12345
insert into mytable (field) values ('XYZ');
show table status like "mytable";
auto_increment: 12345
i had to copy the table's content into a temp table, TRUNCATE the original one and then
re-insert the table's content so that the auto_increment column is being flushed.
i could not reproduce the problem or think of anything that might have caused it ....
-----Ursprüngliche Nachricht-----
Von: Rui Monteiro [mailto:RuiSMonteiro@stripped]
Gesendet: Montag, 30. August 2004 16:59
An: mysql@stripped
Betreff: Duplicate Keys when auto-increment??
Hello there,
Does anyone ever had this problem:
Table Hello ***********
id - (PK) auto-increment
name - text
.
**************************
After some insert's, the table starts to getting erros due to "Duplicate
entry" for the ID.
But the ID is been auto-incremented!
I do something like this:
Insert into hello values ('','wedmwe')
Or
Insert into hello (name) values ('werio')
Why is the error happening now? It started at the 127th entry.
Thanks for the help.