SeunMatt / mysql-backup4j

mysql-backup4j is a library for programmatically exporting mysql databases and sending the zipped dump to email, Amazon S3, Google Drive or any other cloud storage of choice
MIT License
124 stars 71 forks source link

Reimporting a single mysql table containing a longblob column throws exceptions #35

Closed wolframwelschinger closed 2 months ago

wolframwelschinger commented 6 months ago

I created a MySQL database containing a single table with a primary key column, some describing meta data columns and a longblob column. Then I added 3 records containing the meta data. Finally I used MySQL Workbench to upload the images by using its "Load Value From File..." function. Using the MySQL Workbench Value Editor I was able to display the Images correctly. After that I used the MysqlBackup4JIntegrationTest class to verify both export and import of the database. While export ran without complications the import threw exceptions.

I noticed the recommendation to store the images hexadecimally encoded but I have to handle a customer database in which all blobs are already filled up. So I tried to setup my test database nearly the same way like the customer did it.

Hope you can help me by solving the issue.

Perhaps in MysqlExportService the method getDataInsertStatement should should handle blobs as hexadecimally encoded byte arrays rather than handle them as strings?

Here I uploaded my sample dump:

mysqlbackup4j.dump.zip

SeunMatt commented 2 months ago

Issue fixed in version 1.3.0. Please test and provide feedback

wolframwelschinger commented 2 months ago

Hello Seun,

I was surprised to receive your mail today. So it checked out your fixed version 1.3.0. as fast as I could when I was home. Exporting tables containing longblob columns and then importing them to another schema doesn’t cause issues anymore. So I would like to thank you very much.

Best regards!

Wolfram

Am 31.07.2024 um 11:59 schrieb Seun Matt @.***>:

Issue fixed in version 1.3.0. Please test and provide feedback

— Reply to this email directly, view it on GitHub https://github.com/SeunMatt/mysql-backup4j/issues/35#issuecomment-2260134150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3VWLXOTXMLVLKWCJZAJVTZPCYQPAVCNFSM6AAAAABLYDY77KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRQGEZTIMJVGA. You are receiving this because you authored the thread.