Bug #67025 Could not keep character_set_results=latin1 variable in c# project.
Submitted: 30 Sep 2012 17:06 Modified: 30 Sep 2012 18:36
Reporter: Apostolos Katranitsas Email Updates:
Status: Closed Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version:6.5.4 OS:Microsoft Windows (Windows 7 64bit)
Assigned to: CPU Architecture:Any
Tags: Connector/Net, other languages, session variables

[30 Sep 2012 17:06] Apostolos Katranitsas
I set with query 'set session character_set_results=latin1;' but after other query run I see that character_set_results is null. The other query is a simple 'select * from table'.

What is going wrong here?

I tried the same with MySQL Workbench and the character_set_results keeps the setting I assign to it.

I use the mysql-connector-net-6.5.4. with Visual Studio 2010 (SP1) on Windows 7 (64bit). The database is located on linux server (centos) and mysql -V shows: 
    mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (x86_64) using readline 5.1

I've tried to set character-set-client-handshake = false in /etc/my.cnf with no success.

Programming is with c# project.

How to repeat:
Build a sample project with Visual Studio 2010 and try to set the character_set_results=latin1, query some data from any table and see if character_set_results has latin1 or has became null.

In my case is always null after a query.
[30 Sep 2012 18:36] Apostolos Katranitsas
Finally I conclude that was an implementation mistake in codding.

I open and close the connection to mysql on every query and for that the character_set_results was null. On every query I had a new session so session variables was lost.