Bug #2718 Auto Increment feature don't work well with BDB tables
Submitted: 11 Feb 2004 14:20 Modified: 11 Feb 2004 14:52
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.0 OS:alpha
Assigned to: Dean Ellis CPU Architecture:Any

[11 Feb 2004 14:20] [ name withheld ]
Description:
There is a problem with BDB using the auto increment option.  When the record that contains the max value of the field wich has the auto increment feature enable and wich is also the primary key is deleted, the next new record generates with the same value of the deleted record.  
This don't happend with MyISAM tables, where the new id has the value of the deleted record + 1 (this's the correct one).  

How to repeat:
delete the last record inserted in the BDB table and insert a new one.

Suggested fix:
BDB tables should do the same MyISAM tables do whit auto increment fields.
[11 Feb 2004 14:52] Dean Ellis
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

This is mentioned in the CREATE TABLE Syntax chapter of the manual:

"If you delete the row containing the maximum value for an AUTO_INCREMENT column, the value will be reused for an ISAM or BDB table [...]".