MySqlDump HexBlob bug with empty strings?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
lt_ak
Posts: 1
Joined: Mon 11 May 2015 18:08

MySqlDump HexBlob bug with empty strings?

Post by lt_ak » Mon 11 May 2015 18:39

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 ''

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: MySqlDump HexBlob bug with empty strings?

Post by Pinturiccio » Wed 13 May 2015 10:12

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: MySqlDump HexBlob bug with empty strings?

Post by Pinturiccio » Fri 26 Jun 2015 11:51

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.

Pinturiccio
Devart Team
Posts: 2192
Joined: Wed 02 Nov 2011 09:44

Re: MySqlDump HexBlob bug with empty strings?

Post by Pinturiccio » Thu 02 Jul 2015 14:35

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

Post Reply