Bug #44737 objRecordset("m1").value expected to return month name but returns chinese like
Submitted: 8 May 2009 5:31 Modified: 8 May 2009 6:10
Reporter: Ranjit Kolte Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:mysql-connector-odbc-3.51.27-win32 & mys OS:Windows (Windows xp , 2000)
Assigned to: CPU Architecture:Any

[8 May 2009 5:31] Ranjit Kolte
Description:
After upgrading to mysql-connector-odbc-3.51.27-win32.msi  from mysql-connector-odbc-3.51.12-win32.msi application stoped getting monthname in english. on windows xp & 2000 pd with English UK local.

Install mysql-connector-odbc-3.51.27-win32.msi 
Run attached VBS program.
First alert box displays Time properly.
Next alert box display Chinese like characters.
I expect current month and next month to be display.
Same problem is noticed in mysql-connector-odbc-5.1.5-win32.msi also

This same works fine with mysql-connector-odbc-3.51.12-win32.msi

How to repeat:
Run following VBA script

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.ConnectionString = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=localhost;UID=root;PWD=password;DATABASE=test;OPTION=3"
objConnection.Open()
objRecordset.CursorLocation = adUseClient
objRecordset.Open "select now() as time1, monthname(curdate()) as m1, monthname(DATE_ADD(curdate(), INTERVAL 1 MONTH)) as m2" , objConnection

If objRecordset.EOF Then 
    Wscript.Echo "Record cannot be found."
Else
    Wscript.Echo "Record found."
    Wscript.Echo objRecordset("time1").value
    strm1 = objRecordSet.Fields("m1")
    Wscript.Echo strm1
    strm2 = objRecordSet.Fields("m2")
    Wscript.Echo strm2
    Wscript.Echo objRecordset("m1").value
    Wscript.Echo objRecordset("m2").value
End If
objRecordset.Close
objConnection.Close
[8 May 2009 5:34] Ranjit Kolte
Month name but returns chinese like char

Attachment: 44737.doc (application/msword, text), 30.50 KiB.

[8 May 2009 5:36] Ranjit Kolte
Test Case vbs file change connectin details to run

Attachment: getMonthName.vbs (application/octet-stream, text), 938 bytes.

[8 May 2009 6:10] Tonci Grgin
Hi Ranjit and thanks for your report.

When upgrading over so many versions it is always good to check change-log:
3.51.26 (7-Jul-2008)

  Bugs fixed:
  * Added a new connection option FLAG_NO_BINARY_RESULT. Fixed
    field type charset 63 problem. (Bug#29402)

Please check "Always handle binary function results as character data" option in your DSN and be sure to check on associated bug.