[Mono-devel-list] Re: [Mono-patches] r45854 - trunk/mcs/class/System.Data/System.Data

Sureshkumar T tsureshkumar at novell.com
Wed Jun 15 02:41:40 EDT 2005


On Tue, 2005-06-14 at 16:57 +0300, Boris Kirzner wrote:
> Hello Suresh
> I'm not sure this particular fix is correct : for the case that 
> dataset.EnforceConstraints is false, but datatable.EnforceConstraints is 
> true we still should check for possible constraint violation.

100% correct fix. I believe DataSet's EnforceConstraints is the
priority. In case of absence of DataSet, then only DataTable's
EnforceConstraints comes into play (DataTable.cs). With the former case,
anyway we are returning false.

Feel free to send any case, which shows this particular fix is
incorrect. I am glad to fix.

Thanks
suresh.

> 
> Thanks,
> Boris
> 
> suresh <sthangavel at novell.com> wrote:
> 
> >	* ForeignKeyConstraint.cs: IsConstraintViolated: should not check
> >	if EnforceConstraints is false.
> >
> >
> >Modified: trunk/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs
> >===================================================================
> >--- trunk/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs	2005-06-13 05:55:17 UTC (rev 45853)
> >+++ trunk/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs	2005-06-13 06:24:28 UTC (rev 45854)
> >@@ -475,7 +475,11 @@
> > 		
> > 		protected override bool IsConstraintViolated()
> > 		{
> >-			if (Table.DataSet == null || RelatedTable.DataSet == null) return false; //	
> >+			if (Table.DataSet == null || RelatedTable.DataSet == null) 
> >+				return false;
> >+			
> >+			if (!Table.DataSet.EnforceConstraints)
> >+				return false;
> > 				
> > 			bool hasErrors = false;
> > 			foreach (DataRow row in Table.Rows) {
> >  
> >



More information about the Mono-devel-list mailing list