Author: anagappan
Date: 2006-07-26 03:29:12 -0400 (Wed, 26 Jul 2006)
New Revision: 62986
Modified:
trunk/mcs/class/System.Data/System.Data/ChangeLog
trunk/mcs/class/System.Data/System.Data/DataTable.cs
Log:
2006-07-26 Nagappan A <[EMAIL PROTECTED]>
* DataTable.cs (GetIndex): Fixes memory explode on
DataTable.Select - Bug # 77691.
Modified: trunk/mcs/class/System.Data/System.Data/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data/ChangeLog 2006-07-26 06:21:34 UTC
(rev 62985)
+++ trunk/mcs/class/System.Data/System.Data/ChangeLog 2006-07-26 07:29:12 UTC
(rev 62986)
@@ -1,3 +1,8 @@
+2006-07-26 Nagappan A <[EMAIL PROTECTED]>
+
+ * DataTable.cs (GetIndex): Fixes memory explode on
+ DataTable.Select - Bug # 77691.
+
2006-07-25 Nagappan A <[EMAIL PROTECTED]>
* DataView.cs (OnRowCollectionChanged): On DataTable.Clear,
Modified: trunk/mcs/class/System.Data/System.Data/DataTable.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data/DataTable.cs 2006-07-26
06:21:34 UTC (rev 62985)
+++ trunk/mcs/class/System.Data/System.Data/DataTable.cs 2006-07-26
07:29:12 UTC (rev 62986)
@@ -1585,7 +1585,10 @@
columns = (DataColumn[])list.ToArray (typeof
(DataColumn));
}
- Index index = GetIndex(columns, sorts, recordStates,
filter, false);
+ bool addIndex = true;
+ if (filterExpression != String.Empty)
+ addIndex = false;
+ Index index = GetIndex(columns, sorts, recordStates,
filter, false, addIndex);
int[] records = index.GetAll();
DataRow[] dataRows = NewRowArray(index.Size);
@@ -1630,6 +1633,24 @@
return index;
}
+ internal Index GetIndex (DataColumn[] columns,
ListSortDirection[] sort,
+ DataViewRowState rowState, IExpression
filter,
+ bool reset, bool addIndex)
+ {
+ Index index = FindIndex(columns,sort,rowState,filter);
+ if (index == null ) {
+ index = new Index(new
Key(this,columns,sort,rowState,filter));
+
+ if (addIndex)
+ AddIndex (index);
+ }
+ else if (reset) {
+ // reset existing index only if asked for this
+ index.Reset ();
+ }
+ return index;
+ }
+
internal Index FindIndex(DataColumn[] columns)
{
return FindIndex(columns,null,DataViewRowState.None,
null);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches