[Mono-bugs] [Bug 75897][Blo] New - GetPrimaryKeys throwing
IndexOutOfRange accessing oracle
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Aug 24 11:03:45 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 alf at orion.it.
http://bugzilla.ximian.com/show_bug.cgi?id=75897
--- shadow/75897 2005-08-24 11:03:45.000000000 -0400
+++ shadow/75897.tmp.16030 2005-08-24 11:03:45.000000000 -0400
@@ -0,0 +1,125 @@
+Bug#: 75897
+Product: Mono: Runtime
+Version: 1.1
+OS: RHEL 2.1
+OS Details: Red Hat Enterprise Linux ES release 3 (Taroon)
+Status: NEW
+Resolution:
+Severity:
+Priority: Blocker
+Component: misc
+AssignedTo: mono-bugs at ximian.com
+ReportedBy: alf at orion.it
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: GetPrimaryKeys throwing IndexOutOfRange accessing oracle
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+Accessing Oracle 10g through ODBC bombs badly.
+
+Steps to reproduce the problem:
+1. have UnixODBC with Easysoft ODBC Oracle driver
+2. compile and run the appended test file, adapting the connection string
+to your environment
+3. it should bomb after sucessfully connecting with the following:
+
+Actual Results:
+
+Opening:
+DRIVER={ORACLE};DB=//PCOPTI4.think3.com/ORCL;UID=dbatmm;PWD=dbatmm;METADATA_ID=0;ENABLE_USER_CATALOG=1;ENABLE_SYNONYMS=1;
+Opened
+Command created
+Executing
+
+Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
+range.
+in (wrapper stelemref) System.Object:stelemref (object,intptr,object)
+in <0x002cf> System.Data.Odbc.OdbcDataReader:GetPrimaryKeys ()
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcDataReader:GetPrimaryKeys ()
+in <0x00067> System.Data.Odbc.OdbcDataReader:GetSchemaTable ()
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcDataReader:GetSchemaTable ()
+in <0x00095> System.Data.Odbc.OdbcDataReader:.ctor
+(System.Data.Odbc.OdbcCommand command, CommandBehavior behavior)
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcDataReader:.ctor
+(System.Data.Odbc.OdbcCommand,System.Data.CommandBehavior)
+in <0x00038> System.Data.Odbc.OdbcCommand:ExecuteReader (CommandBehavior
+behavior)
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcCommand:ExecuteReader (System.Data.CommandBehavior)
+in <0x0000f> System.Data.Odbc.OdbcCommand:ExecuteReader ()
+in (wrapper remoting-invoke-with-check)
+System.Data.Odbc.OdbcCommand:ExecuteReader ()
+in <0x0000d>
+System.Data.Odbc.OdbcCommand:System.Data.IDbCommand.ExecuteReader ()
+in <0x000e8> Test:Main (System.String[] args)
+[
+
+Expected Results:
+
+Query results
+
+How often does this happen?
+
+Every time
+
+Additional Information:
+
+I tried this with Oracle 9.01 and 10.g, running on Linux & Windows, same thing.
+The very same prog. runs on Windows .NET (not mono) with nary a glitch and
+with a MySql DSN on Linux.
+
+----- Test Program ---
+
+ using System;
+ using System.Data;
+ using System.Data.Odbc;
+
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ string connectionString =
+ // Oracle with string
+ "DRIVER={ORACLE};" +
+ "DB=//PCOPTI4.think3.com/PCOPTI4.CLBO;" +
+ "UID=dbatmm;PWD=dbatmm;" +
+ "METADATA_ID=0;ENABLE_USER_CATALOG=1;ENABLE_SYNONYMS=1;"
+ ;
+ IDbConnection dbcon;
+ Console.WriteLine("Opening: " + connectionString);
+ dbcon = new OdbcConnection(connectionString);
+ dbcon.Open();
+ Console.WriteLine("Opened");
+ IDbCommand dbcmd = dbcon.CreateCommand();
+ Console.WriteLine("Command created");
+ string sql =
+ "SELECT * FROM all_tables";
+ dbcmd.CommandText = sql;
+ Console.WriteLine("Executing");
+
+ IDataReader reader = dbcmd.ExecuteReader();
+ Console.WriteLine("Executed");
+
+ while(reader.Read()) {
+ string FirstName = (string) reader.GetValue(0).ToString();
+ string LastName = (string) reader.GetValue(1).ToString();;
+ Console.WriteLine("Name: " +
+ FirstName + " " + LastName);
+ }
+ // clean up
+ reader.Close();
+ reader = null;
+ dbcmd.Dispose();
+ dbcmd = null;
+ dbcon.Close();
+ dbcon = null;
+ }
+ }
More information about the mono-bugs
mailing list