Bug #13416 Unknown SQL Type 2
Submitted: 23 Sep 2005 3:10 Modified: 25 Oct 2005 14:58
Reporter: Yuri Sprague Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:ODBC 5 OS:Windows (Win 2003)
Assigned to: CPU Architecture:Any

[23 Sep 2005 3:10] Yuri Sprague
Description:
Please see bug 12514, now in the "Can't repeat" category, which contains all the background information.   I've been able to recreate it with modifications to the test code sent to me by Vasiliy Kishkin.  For one thing, he used ODBC 3.51 and I'm using ODBC 5.  As it turns out, the problem lies not with a simple query to the database, which will work without problem, but with using a data adapter to fill a data table with the data returned by the query.   There is some bad interaction between Microsoft's SQL libraries and MySQL.  Please see the project code in the included ZIP file. 

How to repeat:
Using ODBC 5 in a C# project, query a database for data from a decimal field containing a zero value, using the ROUND() function.  The data must be stored into a data table using an ODBC adapter.  At the point where the adapter is filling the data table, an error occurs.  The error message is, "Unknown SQL type - 0".  This problem also occurs with certain text fields.  See bug 12514.  See the file 12514.ZIP for a test project.
[23 Sep 2005 3:10] Yuri Sprague
Project to demonstrate error.

Attachment: 12514.zip (application/x-zip-compressed, text), 6.57 KiB.

[23 Sep 2005 10:12] Vasily Kishkin
I was able to reproduce the bug with using myodbc v5. Thanks for correction.
[22 Oct 2005 2:29] Yuri Sprague
I switched to using ADO.NET to connect and all the "Unknown SQL Type" errors disappeared.  Given that nothing else has changed, this seems to me the clincher to prove that there is definitely a bug in MySQL ODBC.
[25 Oct 2005 14:58] Peter Harvey
This has been corrected in c/odbc v3.51.12.