Mydumper/myloader does not care for 0-s in AUTO_INCREMENT fields
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Data Dumper |
Fix Released
|
Medium
|
Max Bubenick |
Bug Description
While restoring quite a few databases (during a migration with mydumper/myloader), we found that one of our applications threw a strange error. After some investigation it turned out, that in a table with a primary key, the entry with ID=0 was missing (which was there in the original table).
This column is an AUTO_INCREMENT field and mydumper/myloader INSERTs all the rows correctly ... just the one with ID=0 is wrong (well, it gets the new highest ID instead).
Obviously this is a "problem" with how Mysql handles identity inserts. NULLs and 0s are remapped to the new highest value.
BUT, the original mysqldump (and a restore of its export) still handles it correctly .... because they use a special setting:
"NO_AUTO_
http://
It can be seen in each mysqldump script at the beginning:
/*!40101 SET @OLD_SQL_
The question is: would it be possible to include something like this in Mdumper/myloader too ???
And maybe it would be interesting to evaluate all the "special" setting mysqldump puts in its script (just in case, there are other "weirdnesses" it needs to take care off).
Related branches
- MySQL Data Dumper Team: Pending requested
-
Diff: 434 lines (+157/-41)6 files modified.bzrignore (+1/-0)
CMakeLists.txt (+1/-1)
docs/files.rst (+3/-2)
docs/mydumper_usage.rst (+18/-0)
mydumper.c (+131/-37)
myloader.c (+3/-1)
Changed in mydumper: | |
milestone: | none → 0.5.3 |
Changed in mydumper: | |
milestone: | 0.5.3 → 0.6.0 |
assignee: | nobody → Max Bubenick (max-bubenick) |
status: | New → Fix Committed |
Changed in mydumper: | |
importance: | Undecided → Medium |
Changed in mydumper: | |
status: | Fix Committed → Fix Released |
Zeroes in auto-inc fields, eh? :) I'd prefer this to be part of myloader than mydumper, I guess. Having pure data files is a good property, and any loading script can prepend options itself: (echo "..."; cat file) | mysql