[Mono-bugs] [Bug 75137][Nor] Changed - [PATCH] DataSet.Merge() behaviour different from MS .NET

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Jun 3 21:18:32 EDT 2005

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 george.barbarosie at gmail.com.


--- shadow/75137	2005-06-03 21:02:36.000000000 -0400
+++ shadow/75137.tmp.30847	2005-06-03 21:18:31.000000000 -0400
@@ -53,6 +53,31 @@
 ------- Additional Comments From george.barbarosie at gmail.com  2005-06-03 21:02 -------
 Created an attachment (id=15265)
 proposed patch v2
+------- Additional Comments From george.barbarosie at gmail.com  2005-06-03 21:18 -------
+The first patch I submitted was missing some other important
+cornercases; I've actually split DataRow.CopyValuesToRow(DataRow) in
+two functions for two different purposes;
+CopyValuesToRow will make best effort to copy all values to target row
+and make target row have the same status as source row; previous
+version was not accounting for many cases;
+MergeValuesToRow is used when merging datasets and differs from
+CopyValuesToRow only by that it does not delete the Original version
+of target row when source's state is Added.
+In practice all uses of CopyValuesToRow can very well do with the
+"merge" version, now that all glitches have been fixed. If you want to
+keep just one version of the function, I can produce a new patch. But
+I figured that different purposes should be served by different functions.
+With regards to the corner cases I've added to CopyValuesToRow:
+ - row.Original and row.Current can point to the same record (when
+DataRowState.Unchanged); function now checks for this before disposing
+of the record, in two places  (only checked first DisposeRecord() in
+previous version)
+ - make row.Current=row.Original when source row state is unchanged

More information about the mono-bugs mailing list