Bug #14349 after reloading table with mysqldump file, auto_increment remains 1
Submitted: 26 Oct 2005 19:53 Modified: 31 Oct 2005 13:21
Reporter: Brian Ong Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.0.15 Cluster linux x86_64 OS:Linux (RHEL 4 x86_64)
Assigned to: Martin Skold CPU Architecture:Any

[26 Oct 2005 19:53] Brian Ong
Description:
After reloading a table with an INT auto_increment primary key with a mysqldump file, the auto_increment value remains 1.

This means on subsequent inserts into the table, mysql attempts to insert a row with a primary key beginning with 1, which fails because it's a duplicate key.

The storage engine for this table is NDBCLUSTER.

How to repeat:
Backup a database table with an INT auto_increment primary key using mysqldump (in this case dist. 4.1.15).

mysqldump options were:

--no-create-db --no-create-info --skip-extended-insert --single-transaction --complete-insert --hex-blob

Now in version 5.0.15, recreate the database and the table, where the storage engine is NDBCLUSTER.

Reload the table using the command:

mysql -u user -p databaseName < mysqldumpFileName

Then try to insert a row into the table without specifying the value for the primary key.  MySQL will try to insert the row with a primary key value of 1.

Suggested fix:
update the auto_increment value
[26 Oct 2005 22:10] Jorge del Conde
Thanks for your bug report.  I was able to reproduce this bug using FC4-64 with 5.0.16bk.
[31 Oct 2005 12:53] Martin Skold
auto_increment dump

Attachment: dump (application/octet-stream, text), 7.57 KiB.

[31 Oct 2005 13:03] Martin Skold
Unable to reproduce this one. Create a dump file
with mysqldump, see attached file. Tried on 4.1.16
Please add further information what is different.
[31 Oct 2005 13:07] Martin Skold
Now I see.
You are using option --no-create-info,
then table will not be re-created, you should
get duplicate key!
[31 Oct 2005 13:21] Martin Skold
Please add failing dump file, so this
can be reproduced. I could not reproduce
with the attached one I created.