Red Hat Bugzilla – Bug 125804
auto_increment cannot be overridden
Last modified: 2013-07-02 23:01:47 EDT
Description of problem:
When a table is defined as having its primary key "auto_increment",
this cannot be overridden by an insert command.
Version-Release number of selected component (if applicable):
Use the following definition:
create table foo (
id int not null primary key auto_increment,
insert into foo values (0, 'foo');
insert into foo values (1, 'bar');
An error is thrown about having duplicate indicies for the second
insert statement; 'foo' was entered with an index of 1, not 0.
'foo' is entered with an id of 0.
AFAIK this is the intended behavior in MySQL.
Hehe. We had a midair collision. I was just putting that I found
NO_AUTO_VALUE_ON_ZERO -- so never mind. Thanks!