Page 1 of 1

MyDAC 5.0 and TMyDump

Posted: Tue 06 Mar 2007 12:26
by GuzunNicolae
Will there be any updates in TMyDump component in MyDAC 5.0??
Especially I am asking about the following changes:
- add a kind of these lines

Code: Select all

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
at the beginning of the generated script and a kind of these lines

Code: Select all

/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
at the end of the script as mysqldump.exe does
- will there be a good support for dumping views for MySQL 5?

Thanks

Posted: Tue 06 Mar 2007 15:00
by Antaeus
The first feature is already implemented in TMyDump.
Please describe more detailed, what do you mean under a good support for dumping views.

Posted: Tue 06 Mar 2007 15:28
by GuzunNicolae
The first feature is already implemented in TMyDump.
Is it????? I spent one day on fixing this in my project :cry:
Can you please show me how to turn on this feature? Or where can I read about it. I am using MyDAC 4.30.1.15
Please describe more detailed, what do you mean under a good support for dumping views.
If I dump a database, views are treaded as normal tables, only the data is not dumped (while I saw TBackup backups the data from the view, this should be checked too). But in the script there can be such a situation that the view definition is located before the table definition itself, so when the script executes create view statement you will get an error stating that the table does not exist.
First of all tables should be dumped and after that views.

Posted: Wed 07 Mar 2007 12:09
by Antaeus
Can you please show me how to turn on this feature? Or where can I read about it. I am using MyDAC 4.30.1.15
This feature is added in MyDAC 5. You can download the trial version of MyDAC 5 and test it.
First of all tables should be dumped and after that views.
Thank you for your suggestion. We will think about implementing this in the future.

Posted: Wed 07 Mar 2007 15:58
by GuzunNicolae
Very nice.
I will wait for it.

Re: MyDAC 5.0 and TMyDump

Posted: Wed 11 Apr 2007 09:33
by GuzunNicolae
GuzunNicolae wrote:Will there be any updates in TMyDump component in MyDAC 5.0??
Especially I am asking about the following changes:
- add a kind of these lines

Code: Select all

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
at the beginning of the generated script and a kind of these lines

Code: Select all

/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
at the end of the script as mysqldump.exe does
Thanks
Hello
You said this feature will be implemented in MyDAC 5. But it is not.
Yes there is the above line in the header and in footer but there are many more such lines. Look at what mysqldump.exe generates.

Code: Select all

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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 */;
This is for header.
The most important for me is /*!40101 SET NAMES utf8 */;
Without it it is not possible to backup and restore Unicode data normally.

Will this be fixed?

Thanks

Re: MyDAC 5.0 and TMyDump

Posted: Thu 12 Apr 2007 09:07
by Antaeus
GuzunNicolae wrote:The most important for me is /*!40101 SET NAMES utf8 */;
Without it it is not possible to backup and restore Unicode data normally.
Thanks
It is unlikely that this statement will be added to the header of the script generated by TMyDump. This may lead to unforeseen consequences. Try to set the TMyConnection.Options.UseUnicode for forking with Unicode data.

Re: MyDAC 5.0 and TMyDump

Posted: Fri 13 Apr 2007 06:56
by GuzunNicolae
It is unlikely that this statement will be added to the header of the script generated by TMyDump. This may lead to unforeseen consequences. Try to set the TMyConnection.Options.UseUnicode for forking with Unicode data.
Ok, I solved it with setting TMyConnection.Options.UseUnicode to False while resotring, and TMyConnection.Options.Charset to UTF8.
But what will happen if I will want to restore that file with mysqldump.exe ???

Posted: Fri 13 Apr 2007 08:27
by Antaeus
Most possible all Unicode data will be damaged. You should add this line manually to the script header:

Code: Select all

/*!40101 SET NAMES utf8 */;

Posted: Fri 13 Apr 2007 09:39
by GuzunNicolae
So as I understand this feature will not be implemented into MyDAC?

At least as an option. For big files there is a problem adding this line at the beginning of the file. I have to create a temporary file for this cause loading 500Mb in memory is not a very good solution.

Posted: Fri 13 Apr 2007 10:33
by Antaeus
Please specify, why you cannot use TMyDump for dumping and restoring.

Posted: Fri 13 Apr 2007 14:02
by GuzunNicolae
If I use TMyDump for dumping AND restoring there are no problmes.
But if I use TMyDump for dumping and ANOTHER TOOL for restoring as you said data might be lost. Which is not good.

As for possibility to loose data when you will put

Code: Select all

/*!40101 SET NAMES utf8 */;
in the generated script of TMyDump I guess this will not happen if you will add several lines at the end of the script to restore names variable back.

Why don't you add the same header and footer as in mysqldump.exe?

Posted: Tue 17 Apr 2007 08:01
by Antaeus
We will add support for adding commands to set and restore character sets to the SQL script generated by TMyDump. It will be available in the next MyDAC build. We plan to release it in few days.