[Mono-bugs] [Bug 73967][Nor] Changed - System.Data.OdbcDataReader.GetString() returns extra characters

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 22 Mar 2005 16:04:39 -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 dru@druware.com.

http://bugzilla.ximian.com/show_bug.cgi?id=73967

--- shadow/73967	2005-03-22 10:53:20.000000000 -0500
+++ shadow/73967.tmp.13182	2005-03-22 16:04:39.000000000 -0500
@@ -48,6 +48,19 @@
 sequence in VBA under Excel.  The results where duplicated on Mono 1.1.4 on Suse Linux 9.1 
 using the FreeTDS ODBC driver.  Both results used the iODBC driver layer.
 
 ------- Additional Comments From dru@druware.com  2005-03-22 10:53 -------
 Further analysis shows that the extraneous characters are in fact ASCII 32, or SPACE 
 characters.  This behavior is consistent with .NET.  
+
+------- Additional Comments From dru@druware.com  2005-03-22 16:04 -------
+The core issue here is that the GetValue() function returns a 255 char long string 
+regardless of the length of the Data, padded with nulls.  When then passing back to any 
+Odbc datasource, the string is being seen as null terminated.
+
+The GetValue() function either need to remove the extra nulls or check the length of the 
+column before returning data.  There is a performance hit in checking the column size 
+each lookup, but the way the code is currently structured, anything that is not caught in 
+the switch would be effected by the interim hack of simply doing a substring(0, 
+indexof(0x00));
+
+