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

141 строка
6.0 KiB
HTML
Исходник Постоянная ссылка Обычный вид История

2019-06-06 22:03:35 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 75396][Nor] New - Regression in DateTime.Parse
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075396%5D%5BNor%5D%20New%20-%20Regression%20in%20DateTime.Parse&In-Reply-To=bug-75396%40chernobyl.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="031042.html">
<LINK REL="Next" HREF="031044.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 75396][Nor] New - Regression in DateTime.Parse</H1>
<B>bugzilla-daemon at bugzilla.ximian.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%2075396%5D%5BNor%5D%20New%20-%20Regression%20in%20DateTime.Parse&In-Reply-To=bug-75396%40chernobyl.ximian.com"
TITLE="[Mono-bugs] [Bug 75396][Nor] New - Regression in DateTime.Parse">bugzilla-daemon at bugzilla.ximian.com
</A><BR>
<I>Mon Jun 27 17:36:11 EDT 2005</I>
<P><UL>
<LI>Previous message: <A HREF="031042.html">[Mono-bugs] [Bug 75395][Wis] New - Issuing a RowFilter on a
DataView against a DateTime column a
System.InvalidCastException is thrown
</A></li>
<LI>Next message: <A HREF="031044.html">[Mono-bugs] [Bug 75396][Nor] Changed - Regression in DateTime.Parse
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#31043">[ date ]</a>
<a href="thread.html#31043">[ thread ]</a>
<a href="subject.html#31043">[ subject ]</a>
<a href="author.html#31043">[ 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">miguel at ximian.com.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=75396">http://bugzilla.ximian.com/show_bug.cgi?id=75396</A>
--- shadow/75396 2005-06-27 17:36:11.000000000 -0400
+++ shadow/75396.tmp.25833 2005-06-27 17:36:11.000000000 -0400
@@ -0,0 +1,70 @@
+Bug#: 75396
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: CORLIB
+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">miguel at ximian.com</A>
+QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Regression in DateTime.Parse
+
+The change done in r30568 to fix bug #55978 introduce a problem.
+
+Compile the following program like this:
+
+mcs -r:System.Data sample.cs
+mono sample.exe
+
+This produces a crash:
+
+Unhandled Exception: System.InvalidCastException: Cannot cast from source
+type to destination type.
+in &lt;0x0006f&gt; System.Globalization.DateTimeFormatInfo:GetInstance
+(IFormatProvider provider)
+in &lt;0x00031&gt; System.DateTime:Parse (System.String s, IFormatProvider fp,
+DateTimeStyles styles)
+in &lt;0x00016&gt; System.DateTime:Parse (System.String s, IFormatProvider fp)
+in &lt;0x0002e&gt; System.Convert:ToDateTime (System.String value,
+IFormatProvider provider)
+in &lt;0x00014&gt; System.String:System.IConvertible.ToDateTime (IFormatProvider
+provider)
+in &lt;0x005d4&gt; System.Convert:ToType (System.Object value, System.Type
+conversionType, IFormatProvider provider)
+in &lt;0x00032&gt; System.Convert:ChangeType (System.Object value, System.Type
+conversionType)
+in &lt;0x00381&gt; Mono.Data.SqlExpressions.Comparison:Compare (IComparable o1,
+IComparable o2, Boolean caseSensitive)
+in &lt;0x00198&gt; Mono.Data.SqlExpressions.Comparison:EvalBoolean
+(System.Data.DataRow row)
+in &lt;0x00084&gt; Mono.Data.SqlExpressions.BoolOperation:EvalBoolean
+(System.Data.DataRow row)
+in &lt;0x00046&gt; System.Data.Common.Key:GetRecord (System.Data.DataRow row)
+in &lt;0x0010e&gt; System.Data.Common.Index:RebuildIndex ()
+in &lt;0x00013&gt; System.Data.Common.Index:EnsureArray ()
+in &lt;0x0000a&gt; System.Data.Common.Index:get_Array ()
+in &lt;0x0000d&gt; System.Data.Common.Index:GetAll ()
+in &lt;0x00152&gt; System.Data.DataView:UpdateIndex (Boolean force)
+in &lt;0x000e9&gt; System.Data.DataView:set_RowFilter (System.String value)
+in &lt;0x00214&gt; Foo:Main (System.String[] args)
+
+Because the call to NumberFormatInfo.GetInstance (typeof
+(DateTimeFormatInfo)) does not return null, but instead a NumberFormatInfo
+(see the commented code):
+ public object GetFormat (Type formatType)
+ {
+ // work around
+<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=55978">http://bugzilla.ximian.com/show_bug.cgi?id=55978</A>
+ // the comparison fails because formatType likely
+comes from another domain
+ //return (formatType == typeof (NumberFormatInfo))
+? this : null;
+ return this;
+ }
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="031042.html">[Mono-bugs] [Bug 75395][Wis] New - Issuing a RowFilter on a
DataView against a DateTime column a
System.InvalidCastException is thrown
</A></li>
<LI>Next message: <A HREF="031044.html">[Mono-bugs] [Bug 75396][Nor] Changed - Regression in DateTime.Parse
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#31043">[ date ]</a>
<a href="thread.html#31043">[ thread ]</a>
<a href="subject.html#31043">[ subject ]</a>
<a href="author.html#31043">[ 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>