Embedded Server and default collation_connection problem

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
nicenk
Posts: 2
Joined: Mon 21 Mar 2005 17:06

Embedded Server and default collation_connection problem

Post by nicenk » Mon 21 Mar 2005 17:23

Hi

I am using
-MyDAC 3.50.0.16
-MySQL 4.1.7-pro
-Embedded libmysqld.dll

I have set up a database in the client/server mode working fine. The default character set for the db is Greek, and all the tables are created with collation greek_general_ci;

I am trying to switch over to a standalone application, utilizing the same database. Used the embedded option in TMyConnection. After I succesfully connect, i try to run a simple query.
'SELECT iProfileID
FROM profiles
WHERE strProfile = :strProfile'

The error I get is "Illegal mix of collations (greek_general_ci,IMPLICIT) and (latin_swedish_ci,COERCIBLE) for operation '='" and i suspect this comes from the parameter. The parameter gets a correct value before i run the query.

Also if I evalute the TMyConnection.charset i get 'latin_swedish_ci'.

Any ideas how I can fix this problem?

Thank you in advance,
nicenk

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Tue 22 Mar 2005 11:49

At once after establishing a connection execute "SET NAMES ..." query.
For details please see MySQL Reference Manual. You can get the same result if to modify server settings (my.ini).

nicenk
Posts: 2
Joined: Mon 21 Mar 2005 17:06

Did not work

Post by nicenk » Tue 22 Mar 2005 12:56

I've tried the following:

DBMySQLConnection.Database := 'moneymgr';
DBMySQLConnection.Username := strUserName;
DBMySQLConnection.Password := strPassword;
DBMySQLconnection.Open;
DBMySQLconnection.ExecSQL('set names greek;',[]);

then after I execute the query the system posts the same error. Also I've tried with

DBMySQLConnection.Database := 'moneymgr';
DBMySQLConnection.Username := strUserName;
DBMySQLConnection.Password := strPassword;
DBMySQLconnection.Open;
MyCommand := TMyCommand.Create(self);
MyCommand.SQL.Add('set names greek;');
MyCommand.Connection := DBMySQLconnection;
MyCommand.Execute;

and I get the same error.

Nicenk

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 25 Mar 2005 16:18

So these queries are executed at MySQL server not at Embedded server, aren't they? Is libmysqld the same version that your server?

Try to perform SHOW VARIABLES for both servers and send a result to mydac support
address.

Post Reply