Bug #27633 ODBC Connector (mysql-connector-odbc-3.51.14-win32) Problem
Submitted: 4 Apr 2007 5:25 Modified: 4 Apr 2007 10:22
Reporter: Muthu K Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:5.0.37 OS:Windows (Win XP)
Assigned to: CPU Architecture:Any

[4 Apr 2007 5:25] Muthu K
Description:
Hi i updated the latest updated odbc connector
mysql-connector-odbc-3.51.14-win32. Its make a new problem
that is :

asp recordset values are returned like this "????"

note : i am developing a application using asp & mysql.

How to repeat:
plz suggest me.
Muthu
[4 Apr 2007 5:27] Muthu K
i dont use unicode values in my application.
[4 Apr 2007 5:56] Tonci Grgin
Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.mysql.com/how-to-report.php

If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.
[4 Apr 2007 6:12] Muthu K
hi i am developing application using asp & mysql.
recently i was updated the (latest version of mysql odbc connector 3.51.14).
and after i was faced some problem. 

when i was open a recordset using this below query.

rsStrInv=" SELECT"_
& " Invoice_Master.Invoice_ID,"_
& " Invoice_Master.Invoice_Num_ID,"_
& " Invoice_Master.Invoice_No,"_
& " Invoice_Master.Invoice_Date,"_
& " Invoice_Master.Invoice_Type,"_
& " Invoice_Master.Invoice_Cust_ID,"_
& " Invoice_Master.Invoice_Del_Note,"_
& " Invoice_Master.Invoice_Terms_Payment,"_
& " Invoice_Master.Invoice_Supply_Ref_No,"_
& " Invoice_Master.Invoice_Others_Ref_No,"_
& " Invoice_Master.Invoice_Desp_Doc_No,"_
& " Invoice_Master.Invoice_Desp_Doc_Date,"_
& " Invoice_Master.Invoice_Desp_Through,"_
& " Invoice_Master.Invoice_Desp_Destination,"_		
& " Invoice_Master.Invoice_Buy_No,"_
& " Invoice_Master.Invoice_Buy_Date,"_
& " Invoice_Master.Invoice_Remin_Date,"_
& " Invoice_Master.Invoice_Sales_Tax,"_		
& " Invoice_Master.Invoice_Ship_Cost,"_
& " Invoice_Master.Invoice_Spl_Off,"_
& " Invoice_Master.Invoice_Grand_Total,"_
& " Invoice_Master.Invoice_Tax_Type,"_
& " Invoice_Master.Invoice_Tax_Cat,"_
& " Invoice_Master.Invoice_Quote_ID,"_
& " Invoice_Master.Invoice_Quote_Num_ID,"_		
& " Invoice_Master.Invoice_Tax_Head,"_		
& " Invoice_Master.Invoice_Tax_Percentage,"_
& " Invoice_Details.Invoice_ID,"_
& " Invoice_Details.Invoice_Name,"_
& " Invoice_Details.Invoice_Particular,"_
& " Invoice_Details.Invoice_Qty,"_
& " Invoice_Details.Invoice_RPU,"_
& " Invoice_Details.Invoice_Prod_ID,"_
& " Invoice_Details.Invoice_Amount,"_
& " Invoice_Details.Invoice_Total,"_
& " Invoice_Details.Invoice_Num_ID,"_
& " Invoice_Details.Invoice_Amt_Fig,"_		
& " Customer_Details.Customer_Num_ID," _
& " Customer_Details.Customer_Name,"_
& " Customer_Details.Customer_Address,"_
& " Customer_Details.Customer_City,"_
& " Customer_Details.Customer_Pincode"_
& " FROM (Invoice_Master INNER JOIN Invoice_Details"_
& " ON Invoice_Master.Invoice_num_id = Invoice_Details.Invoice_Num_ID"_
& " AND Invoice_Master.Invoice_Tax_Type=Invoice_Details.Invoice_Tax_Type)"_
& " INNER JOIN customer_details ON Invoice_Master.Invoice_cust_id = customer_details.customer_num_id"_
& " WHERE invoice_master.Invoice_Num_ID='"&Trim(Request.Form("INVOICE_ID"))&"' AND Invoice_Master.Invoice_Tax_Type='"&Trim(Request.Form("txtInvType"))&"'"_
& " ORDER BY Invoice_Details.Invoice_Prod_Order ASC"

set cnConn=server.CreateObject("ADODB.Connection") 
set rsInvDisp=server.CreateObject("ADODB.Recordset")

Application("cnStr")="DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=mydb; UID=root;PORT=3306; PWD=mypass; OPTION=3;"	

cnConn.Open(Application("cnStr"))

rsInvDisp.Open(rsStrInv),cnConn,3,3

txtCaption=Trim(rsInvDisp.Fields("Invoice_Quote_ID"))

txtCaption Value is returned like this "?????"
the actual value is "SQR_QUO_0708"

then MonthName(Invoice_Master.Invoice_Date) is returned also like "?????"

Version : MySQL 5.0.37
ODBC    : mysql-connector-odbc-3.51.14

thats my problem.

pls suggest me.
[4 Apr 2007 6:32] Tonci Grgin
Hi and thanks for additional info.
[4 Apr 2007 7:39] Muthu K
Bug Report

Attachment: MyApp.zip (application/x-zip-compressed, text), 5.16 KiB.

[4 Apr 2007 9:46] Tonci Grgin
Hi again.
Since I do not have your tables and data available you didn't really thought I can test, right? Until you provide me with DDL script as well as with some data the report will stay open. If you don't want to share your structures/data, please boil down test case to some simple DB structure and attach it. It would be wise to attach the complete test case with code so I can check it. For now I can say just this:
  - Try with: rsInvDisp.Open(rsStrInv),cnConn,0,3, as it seems you're not modifying your data
  - What is your cursor location (Const adUseNone = 1, Const adUseServer = 2, Const adUseClient = 3)? I strongly suggest adUseClient.
[4 Apr 2007 9:47] Tonci Grgin
Great, you attached it while I was writing my answer :) Dissregard please.
[4 Apr 2007 10:22] Tonci Grgin
Ok, here's what's happening...

First, see Bug#10491. Then, see that both columns returned as '????' have BINARY flag set:
`mydb`.`invoice_master`
`Invoice_quote_id` varchar(45) character set latin1 collate latin1_bin default '-nil-',

Field  44:  `invMonth`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  binary (63)
Length:     10
Max_length: 0
Decimals:   0
Flags:      BINARY

so they are actualy returned with 0x prefix like this:
... 0xApril, 
2006, "Cash", 1, "", "14", "", "", "", <Null>, "Hand", "", "", <Null>, 2006-04-15 00:00:00, 0, 0, 0, 18950, "Sales", "Second Sales", 
0xSQR_QUO-0708, ...
because driver is expecting byte array after examining Flags...

You have 2 options, either loose BINARY flags (by changing query/table structure) or use 3.51.12 for now. This is, in my opinion, not a connector bug but rather we can say that missbehavior of 3.51.12 was working around what seems to be server bug.

Setting this report to duplicate of Bug#10491