Page 1 of 1

MySqlDump HexBlob bug with empty strings?

Posted: Mon 11 May 2015 18:39
by lt_ak
Consider the following table structure:

Code: Select all

DROP TABLE IF EXISTS table_name;
CREATE TABLE `table_name` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `Name` varchar(50) NOT NULL,
  `Data` longblob NOT NULL,
  `MoreStuff` varchar(100) NOT NULL,
  PRIMARY KEY (`ID`),
  KEY `Name_idx` (`Name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
Notice the Data column is marked as NOT NULL. However, it is possible to store an empty string in this column.

If you backup this table using MySqlDump with the HexBlob property set to True it will produce the following in the dump file:

Code: Select all

INSERT INTO table_name VALUES(1,'some_info', ,'more_text');
As you can see, an empty string will be dumped as ,,

If you then attempt to restore this backup you will get an exception:

Code: Select all

Devart.Data.MySql.MySqlException - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1,'some_info', ,'more_text'' at line 1
Setting the HexBlob property to False will produce the following dump:

Code: Select all

INSERT INTO table_name VALUES(1,'some_info', '','more_text');
This can be restored successfully, as the empty string was dumped as ''

Re: MySqlDump HexBlob bug with empty strings?

Posted: Wed 13 May 2015 10:12
by Pinturiccio
We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Re: MySqlDump HexBlob bug with empty strings?

Posted: Fri 26 Jun 2015 11:51
by Pinturiccio
We have fixed the bug with empty BLOBs when executing the MySqlDump.Backup method with MySqlDump.HexBlob set to true. We will post here when the corresponding build of dotConnect for MySQL is available for download.

Re: MySqlDump HexBlob bug with empty strings?

Posted: Thu 02 Jul 2015 14:35
by Pinturiccio
New build of dotConnect for MySQL 8.3.447 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/mysql/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=32064