Error in TMyDump

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Error in TMyDump

Post by eduardosic » Fri 14 Aug 2009 01:40

Hi Devart, i start a project to make backup for a MySQL Server.

testing TMyDump a found the problem:

it's happen if i check backup users

http://www.drdsistemas.com.br/util/error.PNG

I use MyDAC Last version
Delphi 2007 and
MySQL 5.0.37 win32


other question, generating a big backup the restore progress is very very slow. you can add a Option to optimize commit and define data block per transaction.

Like

Begin;
Insert defined row count;
Commit;

Begin;
Insert defined row count;
Commit;

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Re: Error in TMyDump

Post by eduardosic » Tue 18 Aug 2009 23:51

Up.. DevArt team?? here are you..

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 19 Aug 2009 12:34

We have reproduced it. I will let you know about the results of our investigation.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Wed 19 Aug 2009 12:38

Challenger wrote:We have reproduced it. I will let you know about the results of our investigation.
Ok Challenger, thank's and sorry for my impatience. :oops:

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

Post by Dimon » Tue 25 Aug 2009 14:18

We have fixed this problem. This fix will be included in the next MyDAC build.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Tue 25 Aug 2009 17:10

Dimon wrote:We have fixed this problem. This fix will be included in the next MyDAC build.
Hi Dimon, you make only the fix or you make the commit control?

Property..
OptimizeCommit = boolean
DataBlock = Interger

like...

#Row 1-5/10 << DataBlock
begin;
insert into custumers (1,2);
insert into custumers (1,2);
insert into custumers (1,2);
insert into custumers (1,2);
insert into custumers (1,2);
commit;

#Row 6-10/10
begin;
insert into custumers (1,2);
insert into custumers (1,2);
insert into custumers (1,2);
insert into custumers (1,2);
insert into custumers (1,2);
commit;

this is very useful when restoring the script

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

Post by Dimon » Wed 26 Aug 2009 06:30

We have fixed the problem with backup users.
To solve the problem with the commit control you should set the TMyDump.Options.UseExtSyntax property to True to use extended syntax of INSERT on data insertion.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Wed 26 Aug 2009 12:41

Dimon wrote:We have fixed the problem with backup users.
To solve the problem with the commit control you should set the TMyDump.Options.UseExtSyntax property to True to use extended syntax of INSERT on data insertion.
Using the option UseExtSyntax the begin and commit will be included in the script? no.. the backup o f my database have 15GB

i need to insert the begin/commit between X rows, to speed restore process

like EMS Extract Database..


see this..

the original script generated by TMyDump...

Code: Select all

-- MyDAC version: 5.80.0.48
-- MySQL server version: 5.0.37-community
-- MySQL client version: 4.1.3 Direct
-- Script date 26/08/2009 09:49:15
-- ---------------------------------------------------------------------- 
-- Server: localhost
-- Database: cep

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-- 
-- Table structure for table  `all_estados`
-- 

DROP TABLE IF EXISTS `all_estados`;
CREATE TABLE `all_estados` (
  `Sg_Estado` char(2) NOT NULL default '',
  `Nm_Estado` varchar(50) default NULL,
  PRIMARY KEY  (`Sg_Estado`),
  KEY `IdxNm_Estado` (`Nm_Estado`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `all_estados`
-- 

/*!40000 ALTER TABLE `all_estados` DISABLE KEYS */;
INSERT INTO `all_estados` VALUES ('AC', 'Acre');
INSERT INTO `all_estados` VALUES ('AL', 'Alagoas');
INSERT INTO `all_estados` VALUES ('AM', 'Amazonas');
INSERT INTO `all_estados` VALUES ('AP', 'Amapá');
INSERT INTO `all_estados` VALUES ('BA', 'Bahia');
INSERT INTO `all_estados` VALUES ('CE', 'Ceará');
INSERT INTO `all_estados` VALUES ('DF', 'Distrito Federal');
INSERT INTO `all_estados` VALUES ('ES', 'Espírito Santo');
INSERT INTO `all_estados` VALUES ('ET', 'Estrangeiro');
INSERT INTO `all_estados` VALUES ('GO', 'Goías');
INSERT INTO `all_estados` VALUES ('IG', 'Ignorado');
INSERT INTO `all_estados` VALUES ('MA', 'Maranhão');
INSERT INTO `all_estados` VALUES ('MG', 'Minas Gerais');
INSERT INTO `all_estados` VALUES ('MS', 'Mato Grosso do Sul');
INSERT INTO `all_estados` VALUES ('MT', 'Mato Grosso');
INSERT INTO `all_estados` VALUES ('PA', 'Pará');
INSERT INTO `all_estados` VALUES ('PB', 'Paraíba');
INSERT INTO `all_estados` VALUES ('PE', 'Pernambuco');
INSERT INTO `all_estados` VALUES ('PI', 'Piauí');
INSERT INTO `all_estados` VALUES ('PR', 'Paraná');
INSERT INTO `all_estados` VALUES ('RJ', 'Rio de Janeiro');
INSERT INTO `all_estados` VALUES ('RN', 'Rio Grande do Norte');
INSERT INTO `all_estados` VALUES ('RO', 'Rondônia');
INSERT INTO `all_estados` VALUES ('RR', 'Roraima');
INSERT INTO `all_estados` VALUES ('RS', 'Rio Grande do Sul');
INSERT INTO `all_estados` VALUES ('SC', 'Santa Catarina');
INSERT INTO `all_estados` VALUES ('SE', 'Sergipe');
INSERT INTO `all_estados` VALUES ('SP', 'São Paulo');
INSERT INTO `all_estados` VALUES ('TO', 'Tocantins');
/*!40000 ALTER TABLE `all_estados` ENABLE KEYS */;

/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

but.. if the script is big.. the restore process is very Slow.. a goog solution is creat a commit block with a Row number difined..

like This..

setting the New Property RowsInCommitMode..


Code: Select all


-- MyDAC version: 5.80.0.48
-- MySQL server version: 5.0.37-community
-- MySQL client version: 4.1.3 Direct
-- Script date 26/08/2009 09:49:15
-- ---------------------------------------------------------------------- 
-- Server: localhost
-- Database: cep

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
-- 
-- Table structure for table  `all_estados`
-- 

DROP TABLE IF EXISTS `all_estados`;
CREATE TABLE `all_estados` (
  `Sg_Estado` char(2) NOT NULL default '',
  `Nm_Estado` varchar(50) default NULL,
  PRIMARY KEY  (`Sg_Estado`),
  KEY `IdxNm_Estado` (`Nm_Estado`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- 
-- Dumping data for table `all_estados`
-- 

/*!40000 ALTER TABLE `all_estados` DISABLE KEYS */;
begin;
INSERT INTO `all_estados` VALUES ('AC', 'Acre');
INSERT INTO `all_estados` VALUES ('AL', 'Alagoas');
INSERT INTO `all_estados` VALUES ('AM', 'Amazonas');
INSERT INTO `all_estados` VALUES ('AP', 'Amapá');
INSERT INTO `all_estados` VALUES ('BA', 'Bahia');
INSERT INTO `all_estados` VALUES ('CE', 'Ceará');
INSERT INTO `all_estados` VALUES ('DF', 'Distrito Federal');
commit;

begin;
INSERT INTO `all_estados` VALUES ('ES', 'Espírito Santo');
INSERT INTO `all_estados` VALUES ('ET', 'Estrangeiro');
INSERT INTO `all_estados` VALUES ('GO', 'Goías');
INSERT INTO `all_estados` VALUES ('IG', 'Ignorado');
INSERT INTO `all_estados` VALUES ('MA', 'Maranhão');
INSERT INTO `all_estados` VALUES ('MG', 'Minas Gerais');
INSERT INTO `all_estados` VALUES ('MS', 'Mato Grosso do Sul');
INSERT INTO `all_estados` VALUES ('MT', 'Mato Grosso');
INSERT INTO `all_estados` VALUES ('PA', 'Pará');
INSERT INTO `all_estados` VALUES ('PB', 'Paraíba');
commit;

begin;
INSERT INTO `all_estados` VALUES ('PE', 'Pernambuco');
INSERT INTO `all_estados` VALUES ('PI', 'Piauí');
INSERT INTO `all_estados` VALUES ('PR', 'Paraná');
INSERT INTO `all_estados` VALUES ('RJ', 'Rio de Janeiro');
INSERT INTO `all_estados` VALUES ('RN', 'Rio Grande do Norte');
INSERT INTO `all_estados` VALUES ('RO', 'Rondônia');
INSERT INTO `all_estados` VALUES ('RR', 'Roraima');
INSERT INTO `all_estados` VALUES ('RS', 'Rio Grande do Sul');
INSERT INTO `all_estados` VALUES ('SC', 'Santa Catarina');
INSERT INTO `all_estados` VALUES ('SE', 'Sergipe');
INSERT INTO `all_estados` VALUES ('SP', 'São Paulo');
INSERT INTO `all_estados` VALUES ('TO', 'Tocantins');
commit;
/*!40000 ALTER TABLE `all_estados` ENABLE KEYS */;

/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;

with this the time of restoring is very very small..

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Tue 01 Sep 2009 01:06

??

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

Post by Dimon » Thu 03 Sep 2009 08:54

New build of MyDAC version 5.80.0.50 is available for download now.
We added the TMyDump.Options.CommitBatchSize property to add COMMIT statement to script after inserting every CommitBatchSize strings when dumping table data.
Also we fixed bug with backup users in TMyDump.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Thu 03 Sep 2009 17:12

Hi Dimon, i download new build of MyDAC.. the New property CommitBatchSize work's perfect..
but if i check Backup Users a new exception is raised.

Delphi 2007,
Last MyDAC
MySQL 5.0.37-community

see:
http://www.drdsistemas.com.br/util/mydump.png

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

Post by Dimon » Fri 04 Sep 2009 09:51

Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next MyDAC build.

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Fri 11 Sep 2009 15:43

Dimon wrote:Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next MyDAC build.
Hi Dimon, you fix the problem in MyDAC version 5.90?

eduardosic
Posts: 387
Joined: Fri 18 Nov 2005 00:26
Location: Brazil

Post by eduardosic » Sun 13 Sep 2009 04:26

eduardosic wrote:
Dimon wrote:Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next MyDAC build.
Hi Dimon, you fix the problem in MyDAC version 5.90? no, ok, short time..
Dimon, i have two suggestions.

1 - in Event OnBackupProgres, when the backup is started and the first table is processed the value for ObjectNum is 0, on the seconde table the value for ObjectNum is 1. I belive thas is icorrect, please fix this.

2 - MyDump is working very well, but you can create a option to generate a script with REPLACE INTO.... it's very usefull when needs to sincronize databases..

Thank's

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

Post by Dimon » Mon 14 Sep 2009 11:30

eduardosic wrote:1 - in Event OnBackupProgres, when the backup is started and the first table is processed the value for ObjectNum is 0, on the seconde table the value for ObjectNum is 1. I belive thas is icorrect, please fix this.
This behaviour is supported in the current MyDAC build. Please, describe in more details what behaviour you need.
eduardosic wrote:2 - MyDump is working very well, but you can create a option to generate a script with REPLACE INTO.... it's very usefull when needs to sincronize databases..
Thank you for your inquiry. We will investigate the possibility of adding this functionality in the near future. As soon as we solve this question we will let you know.

Post Reply