[Mono-bugs] [Bug 75032][Nor] New - Odbc DataReader errors when getting Memo field from Access database

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue May 24 05:23:31 EDT 2005


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 lukev123 at gmail.com.

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

--- shadow/75032	2005-05-24 05:23:31.000000000 -0400
+++ shadow/75032.tmp.12302	2005-05-24 05:23:31.000000000 -0400
@@ -0,0 +1,138 @@
+Bug#: 75032
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: Windows Server 2003
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Data
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: lukev123 at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Odbc DataReader errors when getting Memo field from Access database
+
+When selecting a Memo field from an Access database the OdbcDataReader
+throws an exception. The actual exception is thrown from the GetString
+method in I18N.Common.ByteEncoding. This error does not happen with the
+Microsoft .Net 1.1 runtime.
+
+Steps to reproduce the problem:
+1. Create an Access database, and add a table (called MyTable) that has a
+Memo field, called  "LongText" for example.
+2. In code, open a connection to the database
+3. Create a new OdbcCommand with a connection to the access database
+4. Set the command text to "SELECT LongText FROM MyTable;"
+5. Create a new DataTable
+6. Create a new OdbcDataAdapter and attach the new OdbcCommand to it.
+7. Call adapter.Fill and pass in the newly created DataTable.
+
+The exception will occur here.
+
+Actual Results:
+
+Testing Odbc Driver. - Luke Venediger
+This test application exposes a flaw in the Mono odbc driver.
+It shows how it doesn't recognise memo fields.
+[test 1] Selecting id, shorttext from testtable in memofield.mdb
+[test 1] SELECT id, shorttext FROM testtable
+[test 1] Row count: 1
+[test 2] Selecting everything from testtable in memofield.mdb
+[test 2] SELECT * FROM testtable
+
+Unhandled Exception: System.ArgumentOutOfRangeException: Argument index is
+out of array range.
+
+Parameter name: count
+
+in [0x00094] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\I18N\Common\ByteEncoding.cs:296)
+I18N.Common.ByteEncoding:GetString (System.Byte[] bytes, Int32 index, Int32
+count)
+
+in [0x003b7] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\System.Data\System.Data.Odbc\OdbcDataReader.cs:736)
+System.Data.Odbc.OdbcDataReader:GetValue (Int32 ordinal)
+
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcDataReader:GetValue (int)
+
+in [0x00019] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\System.Data\System.Data.Odbc\OdbcDataReader.cs:762)
+System.Data.Odbc.OdbcDataReader:GetValues (System.Object[] values)
+
+in [0x0004a] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\System.Data\System.Data.Common\DbDataAdapter.cs:350)
+System.Data.Common.DbDataAdapter:FillTable (System.Data.DataTable
+dataTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords,
+System.Int32 counter)
+
+in (wrapper remoting-invoke-with-check)
+System.Data.Common.DbDataAdapter:FillTable
+(System.Data.DataTable,System.Data.IDataReader,int,int,int&)
+
+in [0x00037] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\System.Data\System.Data.Common\DbDataAdapter.cs:231)
+System.Data.Common.DbDataAdapter:Fill (System.Data.DataTable dataTable,
+IDataReader dataReader)
+
+in [0x0002b] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\System.Data\System.Data.Common\DbDataAdapter.cs:248)
+System.Data.Common.DbDataAdapter:Fill (System.Data.DataTable dataTable,
+IDbCommand command, CommandBehavior behavior)
+
+in [0x00016] (at
+C:\cygwin\home\martinf\mono-1-1-7\mcs\class\System.Data\System.Data.Common\DbDataAdapter.cs:205)
+System.Data.Common.DbDataAdapter:Fill (System.Data.DataTable dataTable)
+
+in (wrapper remoting-invoke-with-check)
+System.Data.Common.DbDataAdapter:Fill (System.Data.DataTable)
+
+in [0x0002f] (at
+C:\Development\Throwaway\AccessError\AccessError\TestCase.cs:70)
+AccessError.TestCase:ExecuteDataTable (System.String statement)
+
+in [0x00085] (at
+C:\Development\Throwaway\AccessError\AccessError\TestCase.cs:37)
+AccessError.TestCase:Main (System.String[] args)
+
+
+Expected Results:
+
+Testing Odbc Driver. - Luke Venediger
+This test application exposes a flaw in the Mono odbc driver.
+It shows how it doesn't recognise memo fields.
+[test 1] Selecting id, shorttext from testtable in memofield.mdb
+[test 1] SELECT id, shorttext FROM testtable
+[test 1] Row count: 1
+[test 2] Selecting everything from testtable in memofield.mdb
+[test 2] SELECT * FROM testtable
+[test 2] Row count: 1
+[test 2] <NewDataSet>
+  <Table1>
+    <id>1</id>
+    <shorttext>A short description</shorttext>
+    <description>this is a long description this is a long description this
+is a long description this is a long description this is a long description
+this is a long description this is a long description this is a long
+description this is a long description this is a long description this is a
+long description this is a long description this is a long description this
+is a long description this is a long description this is a long description
+this is a long description this is a long description this is a long
+description this is a long description this is a long description this is a
+long description this is a long description this is a long
+description</description>
+  </Table1>
+</NewDataSet>
+
+
+How often does this happen? 
+Always.
+
+Additional Information:
+I'm running Mono v1.1.7 on Windows 2003. The Access database version is
+Access 2000.


More information about the mono-bugs mailing list