MySQL 4.0.20 auto_increment bug

Fred <[email protected]> Tue, 03 Aug 2004 21:09:26 -0400
Newsgroups gmane.comp.db.mysql.bugs
Organization HydraNuke.com
Message-ID <1091581766.28150.160.camel@jupiter>
For InnoDB tables, the auto_increment is not handled properly if the
index is updated thus:

create table foobar (id bigint not null auto_increment, primary key(id),
name text) type=InnoDB;

insert into foobar (name) values ("red"), ("green"), ("blue");
-- red is 1, green is 2, blue is 3

update foobar set id = id+10000;
-- red is 10001, blue is 10002, green is 10003, the next auto_increment
entry SHOULD BE 10004

insert into foobar (name) values ("white");
-- white's id is 4 instead of 10004

Version:
mysql  Ver 12.22 Distrib 4.0.20, for pc-linux (i686)

Don't know if this bug exists elsewhere, but I suspect it does.

-- 
Fred Mitchell, HydraNuke.com
E-Commerce and Hosting Solutions 
Whatever you want, we'll make it happen
(603)557-5986
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQBBEDdGVZ97vCsahg4RAgM/AKCGDq2cRptHSZJMTcg7VRzZ50NZjwCgt45o
DvJ/EHhzubGF0mCePKy08PA=
=nCgs
-----END PGP SIGNATURE-----