[Mono-bugs] [Bug 79695][Min] New - Extra space characters issue when using System.Data.DataTable.Select

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Oct 18 18:29:47 EDT 2006


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 anagappan at novell.com.

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

--- shadow/79695	2006-10-18 18:29:47.000000000 -0400
+++ shadow/79695.tmp.8726	2006-10-18 18:29:47.000000000 -0400
@@ -0,0 +1,68 @@
+Bug#: 79695
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: OpenSuSE
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Sys.Data
+AssignedTo: anagappan at novell.com                            
+ReportedBy: anagappan at novell.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Summary: Extra space characters issue when using	System.Data.DataTable.Select
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Extra space characters issue when using	System.Data.DataTable.Select
+
+Steps to reproduce the problem:
+1. http://lists.ximian.com/pipermail/mono-devel-list/2006-October/020967.html
+2. 
+3. 
+
+Actual Results:
+No output displayed
+
+Expected Results:
+When running the above program, Mono outputs nothing, while MS .NET outputs
+'Mike'.
+
+How often does this happen? 
+Always
+
+Additional Information:
+It seems the MS runtime's DataTable.Select ignores any trailing spaces when
+evaluating expressions containing strings. Leading spaces are not ignored.
+Personally, without looking at the spec, I think Mono has the correct idea,
+but it's still a compatibility issue. When using fixed-length character
+fields in database tables, any extra room is normally filled with spaces.
+
+Test Program:
+
+
+using System;
+using System.Data;
+
+class Class1
+{
+	static void Main(string[] args)
+	{
+		System.Data.DataTable dataTable = new
+System.Data.DataTable("Person");
+		dataTable.Columns.Add("Name", typeof(string));
+
+	
+		dataTable.Rows.Add(new object[] {"Mike "}); // notice the
+trailing space
+
+		foreach (System.Data.DataRow row in dataTable.Select("Name =
+'Mike'"))
+			System.Console.WriteLine(row[0]);
+
+	}
+}


More information about the mono-bugs mailing list