[Mono-bugs] [Bug 50762][Nor] New - DataTable.Select fails to match text with brackets

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 1 Apr 2004 13:09:03 -0500 (EST)


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 lluis@ximian.com.

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

--- shadow/50762	2004-04-01 13:09:03.000000000 -0500
+++ shadow/50762.tmp.30843	2004-04-01 13:09:03.000000000 -0500
@@ -0,0 +1,72 @@
+Bug#: 50762
+Product: Mono: Class Libraries
+Version: unspecified
+OS: unknown
+OS Details: Debian unstable - mono from cvs 9 Nov 03
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
+Priority: Normal
+Component: Sys.Data
+AssignedTo: sumadevi@novell.com                            
+ReportedBy: lmaloney@bigpond.net.au               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: DataTable.Select fails to match text with brackets
+
+Description of Problem:
+When using DataTable.Select to find rows with a text field containing
+brackets, no rows are returned.
+
+Steps to reproduce the problem:
+using System;
+using System.Data;
+
+// Compile with: mcs -r:System.Data DataSetTest2.cs
+
+public class DataSetTest2
+{
+	public static void Main()
+	{
+		DataSet set = new DataSet();
+		DataTable data = set.Tables.Add("MyTable");
+
+		data.Columns.Add(new DataColumn("Column1", Type.GetType("System.String")));
+
+		DataRow row = data.NewRow();
+		row["Column1"] = "(Test)";
+		data.Rows.Add(row);
+
+		row = data.NewRow();
+		row["Column1"] = "Test";
+		data.Rows.Add(row);
+
+		DataRow[] rows;
+		rows = data.Select("Column1 = 'Test'");
+		// This gives 1 row
+		Console.WriteLine("Rows containing 'Test': {0}", rows.Length);
+		// This gives 1 row under .NET and 0 rows under mono.
+		rows = data.Select("Column1 = '(Test)'");
+		Console.WriteLine("Rows containing '(Test)': {0}", rows.Length);
+	}
+}
+
+Actual Results:
+Rows containing 'Test': 1
+Rows containing '(Test)': 0
+
+Expected Results: (Observed when testing with MS .NET)
+Rows containing 'Test': 1
+Rows containing '(Test)': 1
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+I am not sure exactly what circumstances cause the problem to occur.
+
+------- Additional Comments From lluis@ximian.com  2004-04-01 13:09 -------
+The recent rewrite of the expression evaluator fixed this.