DESCRIBE doesnt work with UniCode

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ppulkrabek
Posts: 2
Joined: Mon 21 Aug 2006 09:47

DESCRIBE doesnt work with UniCode

Post by ppulkrabek » Thu 10 Apr 2008 15:45

Hi

I'm using Delphi 2006, MyDac 4.40.25, MySQL 4.1.20, my database is in UTF8 coding. In my app I am using DevExpress components to display and work with data. I have had problems corectly display Slovak characters in the grid/editors. Only one solution worked for me and that's setting of TMyConnection.Options.UseUnicode to True. Ok, but then I've got problem fetching results from DESCRIBE command from MySQL using TMyQuery. I've got enum('None',' instead of enum('None','Poor','Good','Excellent').

Here is MySQl table:

CREATE TABLE `customers` (
`CustomerID` INTEGER(11) NOT NULL AUTO_INCREMENT,
`CustomerName` VARCHAR(50) COLLATE utf8_general_ci DEFAULT NULL,
`WebSiteQuality` ENUM('None','Poor','Good','Excellent') DEFAULT 'None',

PRIMARY KEY (`CustomerID`)
)ENGINE=InnoDB COMMENT='InnoDB free: 80896 kB' CHECKSUM=0 DELAY_KEY_WRITE=0 PACK_KEYS=0 MIN_ROWS=0 MAX_ROWS=0 ROW_FORMAT=DYNAMIC CHARACTER SET 'utf8'
COLLATE 'utf8_general_ci' INSERT_METHOD=NO;
COMMIT;

Here is the delphi code:

procedure TfrmMain.bGetEnumValuesClick(Sender: TObject);
var
Query: TMyQuery;
begin
Query := TMyQuery.Create(nil);
try
Query.Connection := MyConnection;
Query.SQL.Text := ' DESCRIBE `customers` '+QuotedStr('WebSiteQuality');
Query.Open;
eEnumValues.Text := Query.Fields[1].AsString;
Query.Close;
finally
Query.Free;
end;
end;

If I set TMyConnection.Options.UseUnicode := False, Query.Fields[1].AsString returns what expected.

Can any one help, please?
Thanks
Pavel

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

Post by Dimon » Fri 11 Apr 2008 13:11

We have fixed this problem in the current MyDAC version. You can upgrade to MyDAC 5 to solve the problem.

ppulkrabek
Posts: 2
Joined: Mon 21 Aug 2006 09:47

Post by ppulkrabek » Fri 11 Apr 2008 13:20

Is there any possible work arround in MyDAC 4.40?

Thanks
Pavel

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

Post by Dimon » Mon 14 Apr 2008 06:42

Please send your registration information to dmitryg*crlab*com. Also specify the Delphi version you are using.

Post Reply