Bug 125804 - auto_increment cannot be overridden
auto_increment cannot be overridden
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tom Lane
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-11 12:18 EDT by Joshua Ginsberg
Modified: 2013-07-02 23:01 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-11 16:14:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Ginsberg 2004-06-11 12:18:34 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):
3.23.58-9

How reproducible:
Use the following definition:
create table foo (
id int not null primary key auto_increment,
s varchar(20)
);

insert into foo values (0, 'foo');
insert into foo values (1, 'bar');
  
Actual results:
An error is thrown about having duplicate indicies for the second
insert statement; 'foo' was entered with an index of 1, not 0.

Expected results:

'foo' is entered with an id of 0.

Additional info:
Comment 1 Tom Lane 2004-06-11 16:14:31 EDT
AFAIK this is the intended behavior in MySQL.
Comment 2 Joshua Ginsberg 2004-06-11 16:16:05 EDT
Hehe. We had a midair collision. I was just putting that I found
NO_AUTO_VALUE_ON_ZERO -- so never mind. Thanks!

-jag

Note You need to log in before you can comment on or make changes to this bug.