string truncation for german special character 'ä'

Mar 4, 2015 at 8:56 AM
Hello,

I found strange problem with MySqlBackup.NET. When data are imported to MySQL database, strings containing special german character ä are truncated. First part of string before ä is imported, but ä and rest of string not.

I tested it using MySqlBackupTestApp.exe demo application.

Default character set of source and target database is utf8. Source table is also utf8, all varchar columns in source table are also uft8.
Here is example of sql file produced by MySqlBackupTestApp.exe.
-- MySqlBackup.NET 2.0.8
-- Dump Time: 2015-03-04 08:09:54
-- --------------------------------------
-- Server version 5.1.34-community-log MySQL Community Server (GPL)


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

-- 
-- Definition of tbl_article
-- 

DROP TABLE IF EXISTS `tbl_article`;
CREATE TABLE IF NOT EXISTS `tbl_article` (
  `article_id` binary(16) NOT NULL,
  `article_no` varchar(10) NOT NULL,
  `name` varchar(64) NOT NULL,
  `product_family_id` binary(16) DEFAULT NULL,
  `modified_date` datetime NOT NULL,
  `modified_user_id` binary(16) NOT NULL,
  `article_type_id` binary(16) NOT NULL,
  `description_translation_text_id` binary(16) NOT NULL,
  `rpl_seq_insert` int(10) unsigned NOT NULL DEFAULT '0',
  `rpl_seq_update` int(10) unsigned NOT NULL DEFAULT '0',
  `rpl_guid` binary(16) NOT NULL DEFAULT 'x\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `rpl_slave` tinyint(3) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`article_id`),
  UNIQUE KEY `name_UNIQUE1` (`name`),
  UNIQUE KEY `article_no_UNIQUE1` (`article_no`),
  UNIQUE KEY `key_rpl_guid` (`rpl_guid`),
  KEY `fk_tbl_article_tbl_product_group1` (`product_family_id`),
  KEY `fk_tbl_article_tbl_article_type1_idx` (`article_type_id`),
  KEY `key_rpl_seq_insert` (`rpl_seq_insert`),
  KEY `key_rpl_seq_update` (`rpl_seq_update`),
  CONSTRAINT `fk_tbl_article_tbl_article_type1` FOREIGN KEY (`article_type_id`) REFERENCES `tbl_article_type` (`article_type_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_tbl_article_tbl_product_family1` FOREIGN KEY (`product_family_id`) REFERENCES `tbl_product_family` (`product_family_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- 
-- Dumping data for table tbl_article
-- 

/*!40000 ALTER TABLE `tbl_article` DISABLE KEYS */;
INSERT INTO `tbl_article`(`article_id`,`article_no`,`name`,`product_family_id`,`modified_date`,`modified_user_id`,`article_type_id`,`description_translation_text_id`,`rpl_seq_insert`,`rpl_seq_update`,`rpl_guid`,`rpl_slave`) VALUES
(0xD32B0504F7033D6864BEB480B220A368,'0020193727','Gehäuse, kpl. RNC Pro China',0x114CADB8E676990C682E623EEF995AC5,'2015-02-20 10:51:32',0x577ADDCEBF35103298CB001B78BF42D0,0x0E9E3E42572E9F947FA4D2E8287DA08D,0x30239D970468AD4981ACA52A100637CB,0,0,0x3B17C45C0A36103387C600155DD54802,1),
(0xD3461AA134E033C759ABBA4D7B36E882,'0020187765','Heat engine L-Gas, Fam. 3 Venturi 18,0mm',0xF8F6872DF4353E9652C5ED7F55433192,'2014-10-15 08:10:41',0xD43C0F793F163294B8381E1C863376F0,0x78DBA0950C271640602FFB15CAF96EB0,0x52D7C22FEBCA09C64F49C28B7F7A8E2C,0,0,0x2C22C6CCA582103287C600155DD54802,1);

/*!40000 ALTER TABLE `tbl_article` ENABLE KEYS */;


/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;


-- Dump completed on 2015-03-04 08:10:09
-- Total time: 0:0:0:15:361 (d:h:m:s:ms)
If I import this example sql file to target database using MySqlBackupTestApp.exe, there will be two rows in table tbl_article, of course.
In first row in column 'name' there have to be value 'Gehäuse, kpl. RNC Pro China' (product name). But there is value 'Geh' only. It means string is truncated.
Very strange is that if I import this example sql file to target database using MySQL Workbench everything is ok, so mentioned column contain right value (full product name).

Is there a way how to solve this issue?

Best Regards
Maroš Klempa
Coordinator
Mar 8, 2015 at 11:14 AM
Message read.
analyzing the problem....
Coordinator
Mar 10, 2015 at 1:26 PM
Edited Mar 10, 2015 at 1:26 PM
Hi dude, I have some projects to do in these one or couple of weeks.
I'll be back once the current project that I'm working for is done.
Sorry for the delay.
I'll see you around.
Mar 10, 2015 at 1:30 PM
Edited Mar 10, 2015 at 1:31 PM
Hi, no problem. Temporary I used mysqldump.exe and mysql.exe for backup/restore MySQL database in my application. I will be happy if late I can replace it with mysqlbackup.dll.

Maroš
Coordinator
Jul 19, 2015 at 10:03 AM
What is the default character set of your MySQL server & database.
Jul 28, 2015 at 11:24 AM
MySQL server default charset is latin1, database default charset is latin1.
Coordinator
Jul 29, 2015 at 12:57 AM
Hi, as far as I know, MySql.Data.DLL might has issue with unicode characters if the default charset of server and database are not UTF8.
You can try again by changing the default charset to UTF8.