mail-archives/mono-bugs/2005-June/030123.html

119 строки
4.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 75177][Nor] New - Read Decimal;
NULL Value gives overflow Exception
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075177%5D%5BNor%5D%20New%20-%20Read%20Decimal%3B%0A%09NULL%20Value%20gives%20overflow%20Exception&In-Reply-To=bug-75177%40chernobyl.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="030122.html">
<LINK REL="Next" HREF="030124.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 75177][Nor] New - Read Decimal;
NULL Value gives overflow Exception</H1>
<B>bugzilla-daemon at bugzilla.ximian.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075177%5D%5BNor%5D%20New%20-%20Read%20Decimal%3B%0A%09NULL%20Value%20gives%20overflow%20Exception&In-Reply-To=bug-75177%40chernobyl.ximian.com"
TITLE="[Mono-bugs] [Bug 75177][Nor] New - Read Decimal;
NULL Value gives overflow Exception">bugzilla-daemon at bugzilla.ximian.com
</A><BR>
<I>Wed Jun 8 08:41:41 EDT 2005</I>
<P><UL>
<LI>Previous message: <A HREF="030122.html">[Mono-bugs] [Bug 74977][Blo] Changed - threads hang during exit
</A></li>
<LI>Next message: <A HREF="030124.html">[Mono-bugs] [Bug 75172][Maj] Changed - large interface crashes mcs
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#30123">[ date ]</a>
<a href="thread.html#30123">[ thread ]</a>
<a href="subject.html#30123">[ subject ]</a>
<a href="author.html#30123">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">timo-mono at pokorra.de.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=75177">http://bugzilla.ximian.com/show_bug.cgi?id=75177</A>
--- shadow/75177 2005-06-08 08:41:41.000000000 -0400
+++ shadow/75177.tmp.26812 2005-06-08 08:41:41.000000000 -0400
@@ -0,0 +1,49 @@
+Bug#: 75177
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.Data
+AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">timo-mono at pokorra.de</A>
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Read Decimal; NULL Value gives overflow Exception
+
+Description of Problem:
+When reading the result of a query, and a decimal column returns a NULL
+value, it gives the exception:
+System.OverflowException: Number overflow.
+
+Steps to reproduce the problem:
+1. sql statement including a decimal column, that is NULL
+
+Actual Results:
+System.OverflowException: Number overflow.
+
+Expected Results:
+DBNull.Value
+
+How often does this happen?
+Always
+
+Additional Information:
+
+The problem is in OdbcDataReader.cs, GetValue(int):
+outsize is -1; new byte [-1] raises the exception.
+
+fix:
+if (outsize!=-1)
+{
+ byte[] temp = new byte[outsize];
+ for (int i=0;i&lt;outsize;i++)
+ temp[i]=buffer[i];
+ DataValue=Decimal.Parse(System.Text.Encoding.Default.GetString(temp));
+}
+else DataValue = DBNull.Value;
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="030122.html">[Mono-bugs] [Bug 74977][Blo] Changed - threads hang during exit
</A></li>
<LI>Next message: <A HREF="030124.html">[Mono-bugs] [Bug 75172][Maj] Changed - large interface crashes mcs
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#30123">[ date ]</a>
<a href="thread.html#30123">[ thread ]</a>
<a href="subject.html#30123">[ subject ]</a>
<a href="author.html#30123">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>