Page 1 of 1

Error MyDump Version 7.16

Posted: Mon 09 Apr 2012 19:26
by cybsistemas
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;

Posted: Tue 10 Apr 2012 10:02
by AndreyZ
Hello,

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

Posted: Tue 10 Apr 2012 11:22
by cybsistemas
It is an unprofessional solution

Posted: Tue 10 Apr 2012 12:24
by AndreyZ
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.

Re: Error MyDump Version 7.16

Posted: Sat 08 Feb 2014 16:40
by nlok888
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?

Re: Error MyDump Version 7.16

Posted: Wed 12 Feb 2014 16:30
by PavloP
We cannot reproduce the problem. Please send the scripts for creating and filling in the table.

Re: Error MyDump Version 7.16

Posted: Thu 13 Feb 2014 02:12
by nlok888
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, '澳門');

Re: Error MyDump Version 7.16

Posted: Mon 17 Feb 2014 16:59
by Dimon
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?

Re: Error MyDump Version 7.16

Posted: Wed 19 Feb 2014 04:33
by nlok888
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".

Re: Error MyDump Version 7.16

Posted: Wed 19 Feb 2014 11:04
by Dimon
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.