2 bugs of mysql dump
Posted: Sat 13 Nov 2010 09:04
MyDAC 5.9.60
Delphi 2010
1. When Set Options' quotename and completeinsert, the field name of insert statement is not quoted
2. utf8 problem has never fixed yet.
I had read the serveral issues of TMyDump and utf8 in the forum and do my own testing and find that the issue had not yet fixed.
I create a simple utf8 table with 3 string fields : latin1, big5, gbk
CREATE TABLE `testunicode` (
`latin1` varchar(50) DEFAULT NULL,
`big5` varchar(50) DEFAULT NULL,
`gbk` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
There is only 1 record.
dbForge export to script as follow (correct) :
INSERT INTO testunicode VALUES
('E B S S y s t e m', '永 富 商 業 系 統', '永 富 商 业 系 统');
When using TMyDump with no setting of encoding :
INSERT INTO testunicode VALUES
('E B S S y s t e m', '? ? ? ? ? ?', '? ? ? ? ? ?');
When using TMyDump with encoding utf8 useunicode true:
INSERT INTO testunicode VALUES
('E B S S y s t e m', '永 富 商 業 系 統', '永 富 商 ? 系 ?');
(The char not in my system encoding (big5) become ?)
When using TMyDump with encoding utf8 useunicode false:
INSERT INTO testunicode VALUES
('E B S S y s t e m', '瘞?撖???璆?蝟?蝯?, '瘞?撖???銝?蝟?蝏?);
Finally, when using text field instead of varchar, even the useunicode = true mode generate the same rubbish as useunicode = false.
The recommended useunicode false mode generate rubbish even without ending quote and so generate error on restoring.
I had see that when using BackupToFile, it use ansi format so I tried to just use backup (To TMyDump.SQL) and then showmessage it but the result is the same.
Delphi 2010
1. When Set Options' quotename and completeinsert, the field name of insert statement is not quoted
2. utf8 problem has never fixed yet.
I had read the serveral issues of TMyDump and utf8 in the forum and do my own testing and find that the issue had not yet fixed.
I create a simple utf8 table with 3 string fields : latin1, big5, gbk
CREATE TABLE `testunicode` (
`latin1` varchar(50) DEFAULT NULL,
`big5` varchar(50) DEFAULT NULL,
`gbk` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
There is only 1 record.
dbForge export to script as follow (correct) :
INSERT INTO testunicode VALUES
('E B S S y s t e m', '永 富 商 業 系 統', '永 富 商 业 系 统');
When using TMyDump with no setting of encoding :
INSERT INTO testunicode VALUES
('E B S S y s t e m', '? ? ? ? ? ?', '? ? ? ? ? ?');
When using TMyDump with encoding utf8 useunicode true:
INSERT INTO testunicode VALUES
('E B S S y s t e m', '永 富 商 業 系 統', '永 富 商 ? 系 ?');
(The char not in my system encoding (big5) become ?)
When using TMyDump with encoding utf8 useunicode false:
INSERT INTO testunicode VALUES
('E B S S y s t e m', '瘞?撖???璆?蝟?蝯?, '瘞?撖???銝?蝟?蝏?);
Finally, when using text field instead of varchar, even the useunicode = true mode generate the same rubbish as useunicode = false.
The recommended useunicode false mode generate rubbish even without ending quote and so generate error on restoring.
I had see that when using BackupToFile, it use ansi format so I tried to just use backup (To TMyDump.SQL) and then showmessage it but the result is the same.