Bug #31863 Duplicate entry error in auto-inc after mysqld restart
Submitted: 25 Oct 2007 18:24 Modified: 7 Jan 2008 23:24
Reporter: Sveta Smirnova Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.0 BK OS:Any
Assigned to: Sunny Bains CPU Architecture:Any

[25 Oct 2007 18:24] Sveta Smirnova
Description:
Wrong "duplicate entry" error occurs after server restart.

How to repeat:
use test
drop table if exists t;
create table t(`_id` bigint(20) NOT NULL auto_increment primary key)engine=innodb;
insert into t values(-10);
select * from t;

mysqld restart

use test
insert into t values(null),(null);
ERROR 1062 (23000): Duplicate entry '9223372036854775807' for key 1
select * from t;
+-----+
| _id |
+-----+
| -10 |
+-----+
1 row in set (0.00 sec)