Bug #3076 Update of autoincrement field
Submitted: 5 Mar 2004 6:24 Modified: 7 Oct 2005 18:50
Reporter: Luca Morelli Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S4 (Feature request)
Version:4.1.1 OS:Windows (windows)
Assigned to: CPU Architecture:Any

[5 Mar 2004 6:24] Luca Morelli
Description:
i created a table with an autoincrementing integer field as primary key i added a record normally, after this i used an UPDATE statement to change the key value from 1 ( the values assigned automatically ) to 500, and the update was made correctly, and when i inserted another record the value assigned to the primary kwy was 501.

How to repeat:
the same as above

Suggested fix:
I think this is not a bug but a feature, because i tested in 4.1.1 and 4.0.18 and work same way, but i see that some other database prevents that you even by mistake change the values of the autoincremented values. I think is better to change this behavior.
[7 Oct 2005 18:50] Hartmut Holzgraefe
The only guarantee we give on auto_increment fields is that they are counting up,
not that there will be no gaps (gaps may be created by InnoDB e.g. on transaction
rollback).
So preventing users from changing the auto_increment field doesn't make any sense
either as the only use i see from that would be the prevention of gaps.
You may try to restrict access to the auto_increment field using field level 
access restrictions though...