Bug #2480 loading a sql file with 0 as primary key autoincrements istead of create 0 entr

Submitted: 22 Jan 2004 5:31 Modified: 22 Jan 2004 9:17
Reporter: Maciej Zobniow Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.0.17 and rest too OS:Linux (Linux)
Assigned to: Dean Ellis CPU Architecture:Any

[22 Jan 2004 5:31] Maciej Zobniow
Description:
I have a table with primary key as int(11). I have one entry in this table with value 0. If I trying to load sql file from dump (mysqldump), loading fail. I found that it's because of strange and unproper behavior of sql file loading. In this file I have statement like this:
INSERT INTO AUI_ENTITY_DEFAULT VALUES(0,2345,NULL,NULL,'smi.cmp.imp.selection.opt','16842','STORE','',0);
and when this entry is executed in mysql db, I see that firs value was autoincrement insted of just insert row with value 0!
When I am doing exactly same operation from for example MySQLCC, I  have proper entry (with value 0 in first column).

How to repeat:
Just make a table with first value, primary key as int(11), then put an entry with pkey 0 Then dump this database by mysqldump, drop db from mysql and load data from dumped file. If insert query for row with value 0 will be not on the first position in this file (as I have in my dump files) you should see that this row was inserted with autoincremented value instead of 0. 

Suggested fix:
Don't know :(.
[22 Jan 2004 5:34] Maciej Zobniow
I just changed priority
[22 Jan 2004 9:17] Dean Ellis
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

Inserting a 0 into an auto_increment column (except with MySQL 4.1.1's NO_AUTO_VALUE_ON_ZERO flag) will generate a new value, as documented in the manual.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.047 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
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.