Error MyDump Version 7.16

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
cybsistemas
Posts: 118
Joined: Mon 12 Sep 2005 17:31
Location: Argentina

Error MyDump Version 7.16

Post by cybsistemas » Mon 09 Apr 2012 19:26

Myconection1.options.useunicode := True;
Mydump1.BackupToFile('bac.sql');

DROP TABLE IF EXISTS PASIVOS;
CREATE TABLE `pasivos` (
`Id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`Nombre` char(30) DEFAULT NULL,
`Saldo` float(12,2) DEFAULT NULL,
`NoBorrar` tinyint(1) DEFAULT NULL,
`Cuenta` char(8) DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `Nombre` (`Nombre`(8))
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table PASIVOS
--

LOCK TABLES PASIVOS WRITE;
INSERT INTO PASIVOS VALUES
(1, 'ALQUILER', NULL, NULL, '42206000'),
(2, 'LIBRERIA Y KIOSCO', NULL, NULL, '42304000'),
(3, 'Campiña', NULL, NULL, NULL), Error : Campiña
(4, 'CAMPIÑA', NULL, NULL, NULL), Error : CAMPIÑA
(5, 'Escuela N°', NULL, NULL, NULL), Error : Escuela N°
(6, 'Posición', NULL, NULL, NULL); Error : Posición
UNLOCK TABLES;

AndreyZ

Post by AndreyZ » Tue 10 Apr 2012 10:02

Hello,

To solve the problem, you should set the UseUnicode property to False.

cybsistemas
Posts: 118
Joined: Mon 12 Sep 2005 17:31
Location: Argentina

Post by cybsistemas » Tue 10 Apr 2012 11:22

It is an unprofessional solution

AndreyZ

Post by AndreyZ » Tue 10 Apr 2012 12:24

When UseUnicode is set to True, data is encoded to the UTF16 format. When backing up to a file process is performed, data is stored to the UTF8 format. These formats are incompatible with each other. That's why you should disable the UseUnicode property and set the Charset property to UTF8 before backing up data.

nlok888
Posts: 3
Joined: Fri 23 Sep 2011 17:17

Re: Error MyDump Version 7.16

Post by nlok888 » Sat 08 Feb 2014 16:40

I am using myDac version 7.6.12 with Delphi XE.
MySql version 5.5 with type of innodb and collation is "utf8_general_ci".

Same problem for direct backup to file even I set the UseUnicode to false.
My unicode text field becomes a mess in the backup file.

Code: Select all

MyConnection1.Close;
MyConnection1.Options.UseUnicode:=false;
MyConnection1.Options.Charset:='utf8';
MyConnection1.Open;
MyDump1.BackupToFile(FileName);
Generated sql statement inside file:

Code: Select all

INSERT INTO table1 (f_id, f_caption) VALUES
  (1, '銝剖?'),
  (2, '擐葛'),
  (3, '瞉喲?')
Which should be:

Code: Select all

1, 中國
2, 香港
3, 澳門
Any solution?

PavloP
Devart Team
Posts: 149
Joined: Fri 24 Jan 2014 12:33

Re: Error MyDump Version 7.16

Post by PavloP » Wed 12 Feb 2014 16:30

We cannot reproduce the problem. Please send the scripts for creating and filling in the table.

nlok888
Posts: 3
Joined: Fri 23 Sep 2011 17:17

Re: Error MyDump Version 7.16

Post by nlok888 » Thu 13 Feb 2014 02:12

Here you go.

Code: Select all

DROP TABLE IF EXISTS `table1`;
CREATE TABLE IF NOT EXISTS `table1` (
  `f_id` int(11) NOT NULL AUTO_INCREMENT,
  `f_name` varchar(10) NOT NULL,
  PRIMARY KEY (`f_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `table1`
--

INSERT INTO `table1` (`f_id`, `f_name`) VALUES
(1, '中國'),
(2, '香港'),
(3, '澳門');

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Error MyDump Version 7.16

Post by Dimon » Mon 17 Feb 2014 16:59

Please, make sure that the TMyDump component backs up data incorrectly.
For this, store the table to a file and then restore data from the received script, like this:

Code: Select all

MyConnection1.Close;
MyConnection1.Options.UseUnicode := false;
MyConnection1.Options.Charset := 'utf8';
MyConnection1.Open;
MyDump1.BackupToFile(FileName);
MyDump1.RestoreFromFile(FileName);
Is the result data in the database correct?

nlok888
Posts: 3
Joined: Fri 23 Sep 2011 17:17

Re: Error MyDump Version 7.16

Post by nlok888 » Wed 19 Feb 2014 04:33

Dear Dimon,
Nop. The result data in database is not correct.
Any idea?
I am using myDac version 7.6.12 with Delphi XE.
MySql version 5.5 with type of innodb and collation is "utf8_general_ci".

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: Error MyDump Version 7.16

Post by Dimon » Wed 19 Feb 2014 11:04

Unfortunately, we still can not reproduce the problem.
Please, try to download the latest MyDAC build (8.2.5) and check if the problem still exists.

Post Reply