MySQL Forums
Forum List  »  Newbie

Re: AUTO_INCREMENT value increases by powers of two after INSERT ... SELECT
Posted by: Chad Bourque
Date: November 13, 2009 04:32PM

Barry,

I'm afraid you are incorrect. When I do this:
create table aiTest
(
  id int not null auto_increment primary key,
  col1 char(1) not null
);

insert into aiTest (id, col1) values
  (null, 'a'),
  (null, 'b'),
  (null, 'c'),
  (null, 'd'),
  (null, 'e');

select * from aiTest;
I get 5 results with the ids 1 - 5. Granted, this is illegal in M$SQL, but it's fair game in MySQL. This works on at least MYISAM and INNODB tables (probably all the others as well).

HTH,
Chad

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.