The thread is old, however we got similar error recently with rails 2 and mysql 5.1. It was related to missing fixtures, however the problem with mysql
our installation is mysql 5.1.22 on CentOS 5 and 5.1.30 on Debian we were able to reproduce the error with simple seqence of sql commands
select version();
DROP TABLE IF EXISTS test_inc; CREATE TABLE `test_inc` ( `id` int(11) NOT NULL AUTO_INCREMENT, `account_id` int(11) NOT NULL, PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
select 'insert explicit 9. must become 10'; insert into test_inc ( id, account_id) values (9,1); select * from test_inc; show create table test_inc \G select 'delete all. stays 10'; delete from test_inc; select * from test_inc; show create table test_inc \G
select 'insert autoincrement. must become 11'; insert into test_inc ( account_id) values (1) ; select * from test_inc ; show create table test_inc \G select 'delete all. stays 11'; delete from test_inc ; select * from test_inc ; show create table test_inc \G
select 'insert explicit 11. must become 12, but stays 11'; insert into test_inc ( id, account_id) values (11,1); select * from test_inc; show create table test_inc \G
/* select 'insert explicit 12. must become 13'; insert into test_inc ( id, account_id) values (12,1); select * from test_inc; show create table test_inc \G */
select * from test_inc; show create table test_inc \G select 'insert auto-increment'; insert into test_inc ( account_id) values (1); select * from test_inc; show create table test_inc \G
I've opened a bug with mysql, however they 'closed' it as unable to reproduce