http://bugzilla.novell.com/show_bug.cgi?id=524254
Summary: OracleClient causes exception when unsigned types or
bools are used in an OracleParameter
Classification: Mono
Product: Mono: Class Libraries
Version: unspecified
Platform: 32bit
OS/Version: openSUSE 11.0
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Data
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: ---
Created an attachment (id=306888)
--> (http://bugzilla.novell.com/attachment.cgi?id=306888)
Patch to fix the problem
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US)
AppleWebKit/530.5 (KHTML, like Gecko) Chrome/2.0.172.37 Safari/530.5
When a CLR Type of UInt16, UInt32, UInt64 or Boolean is used in an
OracleParameter, an exception will happen.
I have fixed the issue and attach a diff
Reproducible: Always
Steps to Reproduce:
1. Add test code below to OracleParameterTest.cs in
mcs/class/System.Data.OracleClient/OracleParameterTest.cs
2. Compile and Run the test code
3. Watch it fail the tests
[Test]
public void TestInferOracleType ()
{
OracleParameter id = new OracleParameter ();
id.Value = (sbyte)1;
Assert.AreEqual ( OracleType.SByte, id.OracleType );
id.Value = (short)1;
Assert.AreEqual ( OracleType.Int16, id.OracleType );
id.Value = (int)1;
Assert.AreEqual ( OracleType.Int32, id.OracleType );
id.Value = (long)1;
Assert.AreEqual ( OracleType.Number, id.OracleType );
id.Value = (byte)1;
Assert.AreEqual ( OracleType.Byte, id.OracleType );
id.Value = (ushort)1;
Assert.AreEqual ( OracleType.UInt16, id.OracleType );
id.Value = (uint)1;
Assert.AreEqual ( OracleType.UInt32, id.OracleType );
id.Value = (ulong)1;
Assert.AreEqual ( OracleType.Number, id.OracleType );
id.Value = true;
Assert.AreEqual ( OracleType.Byte, id.OracleType );
id.Value = "Hello World";
Assert.AreEqual ( OracleType.VarChar, id.OracleType);
id.Value = DateTime.Now;
Assert.AreEqual ( OracleType.DateTime, id.OracleType );
id.Value = (decimal)1;
Assert.AreEqual ( OracleType.Number, id.OracleType );
id.Value = new byte[] {1, 2, 3 };
Assert.AreEqual ( OracleType.Raw, id.OracleType);
id.Value = Guid.NewGuid();
Assert.AreEqual ( OracleType.Raw, id.OracleType );
id.Value = (float)1;
Assert.AreEqual ( OracleType.Float, id.OracleType );
id.Value = '1';
Assert.AreEqual ( OracleType.Char, id.OracleType );
} // end TestInferOracleType
Actual Results:
Tests fail
Expected Results:
Tests pass
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs