Bug #26744 varchar and text field doesn't return the same result with latin1
Submitted: 1 Mar 2007 9:15 Modified: 23 Nov 2007 11:14
Reporter: v locht Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.0.11 OS:Windows (windows)
Assigned to: Jess Balint CPU Architecture:Any

[1 Mar 2007 9:15] v locht
Description:
The varchar and text type fields behave differently on accented characters. 
Varchar is correct and text field is not. If I change the connection character set ("set names 'latin1'"), the problem is switched! varchar is not correct but text is then correct

SERVER: Mysql 5.0.27, Connector: MyODBC 5.0.11

How to repeat:
Install a 5.0 server, default character set is 'latin1'

Create a table whith a ref_key, a varchar and a text fields:

CREATE TABLE  `test`.`test_char` (
  `ref` int(10) unsigned NOT NULL auto_increment,
  `charstring` varchar(45) NOT NULL,
  `textstring` text NOT NULL,
  PRIMARY KEY  (`ref`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

fill the table with the same accented text in varchar and text field, for instance 'Démonstration'

Make a select * on the table using the myodbc connector

select * from test_char;

, the result looks like:
1	Démonstration	Démonstration
[1 Mar 2007 11:02] Jess Balint
Do you need ISO-8859-1;Latin-1 here, or do you need UTF-8?

There is more to getting the driver to handle it, than SET NAMES at this point.
[1 Mar 2007 13:14] MySQL Verification Team
Changing to need feedback according as requested by Balint.
[1 Mar 2007 13:28] v locht
When I test with the connector, the connection is automatically utf8.
My problem is that the fields of VARCHAR type behave correctly (I get the text with single accented characters in my client application) BUT TEXT fields returns the accented characters as a pair like "é" become "é"
[8 Mar 2007 9:24] v locht
Two fields in the same table from a database, created with the same characterset (latin1 for instance), are different only by their type (VARCHAR or TEXT) They are filled with the same value. They MUST return the same value in simple "select * from table" request. That's NOT the case whith the connector! I don't think the characterset from the connection is the matter, because if I change something about characterset, the result is changed, but the two fields return different values!
[8 Mar 2007 9:26] v locht
I need latin1 output, but the most important to me is to get the same result from the two fields
[5 Apr 2007 11:03] v locht
Hello,
I hope that a solution is on his way..
Thank you.
[20 Apr 2007 20:26] horvoje bob
I have mysql database and using ms-access for data editing. There is really problem with "text" fields. You can see it on PNG image (620 bytes): http://www.cuspajz.com/imagez/bug_or_error.png
On this picture there are two fields, varchar & text field and they are holding the same data. Varchar field is displayed as expected and text field is as you can see.
[20 Apr 2007 20:30] horvoje bob
here you can see how the characters are displayed

Attachment: bug_or_error.png (image/x-png, text), 620 bytes.

[14 Jun 2007 0:30] Jared S
1 Solution would be using GA Connector/ODBC 3.51.15b ;)
[22 Oct 2007 12:10] Susanne Ebrecht
Hi,

I can't reproduce this, by using our new MyODBC driver version 5.1.
Please, try it with MyODBC version 5.1.

Regards,

Susanne
[23 Nov 2007 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[23 Nov 2007 11:14] v locht
"Mysql ODBC 5.1 Driver" is OK.
The problem doesn't occures with this one.
Thank you for your help.