[Mono-bugs] [Bug 49561][Maj] New - Casting error in libodbc.cs
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Tue, 30 Mar 2004 12:33:31 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by lluis@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=49561
--- shadow/49561 2004-03-30 12:33:31.000000000 -0500
+++ shadow/49561.tmp.5755 2004-03-30 12:33:31.000000000 -0500
@@ -0,0 +1,55 @@
+Bug#: 49561
+Product: Mono: Class Libraries
+Version: unspecified
+OS: unknown
+OS Details:
+Status: RESOLVED
+Resolution: FIXED
+Severity: Unknown
+Priority: Major
+Component: Sys.Data
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: seifert@everybody.org
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Summary: Casting error in libodbc.cs
+
+I found a casting error in libodbc.cs for the method SQLDescribeCol. The
+ColumnSize parameter should be an unsigned integer, not a short. From the
+declaration from the MySQL ODBC driver:
+
+SQLRETURN SQL_API
+SQLDescribeCol(SQLHSTMT hstmt, SQLUSMALLINT icol,
+ SQLCHAR FAR *szColName,
+ SQLSMALLINT cbColNameMax,
+ SQLSMALLINT FAR *pcbColName,
+ SQLSMALLINT FAR *pfSqlType,
+ SQLUINTEGER FAR *pcbColDef,
+ SQLSMALLINT FAR *pibScale,
+ SQLSMALLINT FAR *pfNullable)
+
+The attached patches fix this error.
+
+------- Additional Comments From seifert@everybody.org 2003-10-11 14:53 -------
+Created an attachment (id=5559)
+Patch for System.Data.Odbc.OdbcDataReader
+
+
+------- Additional Comments From seifert@everybody.org 2003-10-11 14:54 -------
+Created an attachment (id=5560)
+Patch for System.Data.Odbc.libodbc
+
+
+------- Additional Comments From seifert@everybody.org 2003-11-29 11:46 -------
+This has been sitting here for a while and untouched, so perhaps I
+should elaborate some more...
+
+ODBC drivers assume the ColumnSize parameter is an unsigned integer.
+By setting it to a short in the Mono code, the previous parameter (the
+DataType) gets overridden with the upper bits from the ColumnSize.
+Usually this means that a DataType of 0 gets returned no matter what,
+making the results very hard to decipher.
+
+------- Additional Comments From lluis@ximian.com 2004-03-30 12:33 -------
+The patch is already applied. Closing the bug