Restore Database appears to be mangling dump file as Unicode
See original GitHub issueWhenever I try to use the Restore database functionality to restore a dump file into my MariaDB database, I get the following error message:
ERROR 1062 (23000) at line 799: Duplicate entry '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xEF\xBF\xBD\xEF\xBF\xBD' for key 'PRIMARY'
After investigating the error, I found out that my dump file (dumped with DBeaver) did not have this sequence of bytes anywhere in the file. The error message was pointing to a section of the file with a bunch of raw binary data. I soon realized that EF BF BD is the Unicode replacement character byte sequence - �. I then tried to import the dump file using mysql
at the command line, and had no issues, both db server and locally using the same mysql I pointed DBeaver at.
Thus, I conclude that somewhere along the line, DBeaver is parsing my dump file as Unicode and replacing any invalid byte sequences with the replacement character. This is not desirable - the file should be treated as binary and passed through to mysql
untouched.
I am using the macOS version of DBeaver 4.3.3.1 and the 2.2.1 version of the MariaDB driver. My command line tools and server are all version 10.2.12-MariaDB. For what it’s worth, the dump I was using was dumped with the same version of DBeaver a few moments earlier, and I did not find that problematic byte sequence in the file, so as far as I can tell, dumping data works just fine.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Please one more time. One more small bug was fixed.
To people using
HeidiSQL
, update your version to the latest (9.5 at writing of this comment).