Bug #33299 Trying to insert east-asian (or non latin) data into a recordset fails
Submitted: 17 Dec 2007 20:27 Modified: 14 Mar 2014 4:54
Reporter: Michael Pryor (Candidate Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.1.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: optional feature not implemented

[17 Dec 2007 20:27] Michael Pryor
Description:
Using a MyODBC 5.1.1 connector to a MyODBC 5x database, one cannot insert non latin characters such as korean.

How to repeat:
Start with a UTF8 db

mysql> create database A;
mysql> use A;
mysql> create table B (c longtext, d datetime);
mysql> alter database A charset=utf8;
mysql> alter table B charset=utf8;
mysql> alter table B modify c longtext character set utf8;

Create a file called test.asp and drop it in your web server somewhere.  Put the followin in it:

--------------test.asp--------------------
<%@codepage=65001%>
<%
Session.CodePage = 65001

Const adOpenKeyset = 1
Const adLockOptimistic = 3

Dim db: set db = server.createobject("adodb.connection")
db.open "DRIVER={MySQL ODBC 5.1 Driver};PORT=3306;SERVER=localhost;USER=root;PASSWORD=abcdef;DATABASE=A"

Dim rs: Set rs = Server.Createobject("adodb.recordset")
rs.Open "SELECT * FROM B WHERE d = NULL", db, adOpenKeyset, adLockOptimistic
rs.AddNew 
rs("d").Value = Now()
rs("c").Value = Request("c")

If Len(Request("c")) > 1 Then
	rs.update
End If

%>

<form method=POST>
<textarea name="c">
</textarea>
<input type="submit" />
</form>

----------------------test.asp------------------------

Load up test.asp in a web browser.

Try copying this and pasting into the textarea:
	

프로그래머를 위한 사용자 인터페이스 설계론

Then hit submit.
[2 Jan 2008 9:16] Tonci Grgin
Hi Michael. This problem has been actively worked on by devs.
[3 Jan 2008 6:09] Jess Balint
After testing this with the fix for bug#32064, I've discovered it relies on data-at-exec support in positioned updates, which isn't currently implemented.

However, testing shows that you can workaround this. Instead of using a text column, use a varchar column up to 1300 characters (which is returned as 3900 bytes due to 3-byte UTF-8 support).

Also, this limitation has nothing to do with the data (Unicode and ASCII both exhibit the same behaviour).
[17 Jan 2008 20:54] Jess Balint
There is no plan to fix this bug in Connector/ODBC 5.1 branch. Setting target fix version to 5.2.
[31 Jan 2008 23:39] Jason Williams
This is really disappointing. Its been plaguing us since the 3.5.1 connector for about 2 years now. What's the target dates for 5.2?
[13 Mar 2014 13:36] Omer Barnir
This bug is not scheduled to be fixed at this time.
[14 Mar 2014 4:54] Bogdan Degtyariov
5.2 fails to insert the correct data as well.