#At file:///C:/Documents%20and%20Settings/Reggie/work/connector-net/6.0/ based on revid:reggie.burnett@stripped
854 Reggie Burnett 2010-12-14
- removed extra call to Update in MySqlDataAdapter introduced with bug fix to bug #54863.
It seems to not be necessary (bug #58853)
modified:
CHANGES
MySql.Data/Provider/Source/dataadapter.cs
MySql.Data/Tests/Source/DataAdapterTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2010-12-14 14:56:49 +0000
+++ b/CHANGES 2010-12-14 20:48:01 +0000
@@ -15,6 +15,8 @@
(bug #55349)
- change reader to close the connection if CommandBehavior.CloseConnection is given and an
exception is generated (bug #58652)
+- removed extra call to Update in MySqlDataAdapter introduced with bug fix to bug #54863.
+ It seems to not be necessary (bug #58853)
Version 6.0.7
- Fix authorization popup after modifying stored procedure in VS (Bug #44715)
=== modified file 'MySql.Data/Provider/Source/dataadapter.cs'
--- a/MySql.Data/Provider/Source/dataadapter.cs 2010-10-07 21:01:53 +0000
+++ b/MySql.Data/Provider/Source/dataadapter.cs 2010-12-14 20:48:01 +0000
@@ -179,19 +179,6 @@
int ret = base.Update(dataRows, tableMapping);
- // Following was a workaround for Bug#54863
- // It a good question whether we still needed it, it seems like
- // .NET bug (DbDataAdapter not issuing AcceptChanges() for
- // modified rows) has already been fixed in .NET
- foreach (DataRow row in dataRows)
- {
- if (row.RowState != DataRowState.Unchanged &&
- row.RowState != DataRowState.Detached)
- {
- row.AcceptChanges();
- }
- }
-
return ret;
}
finally
=== modified file 'MySql.Data/Tests/Source/DataAdapterTests.cs'
--- a/MySql.Data/Tests/Source/DataAdapterTests.cs 2010-07-12 14:38:02 +0000
+++ b/MySql.Data/Tests/Source/DataAdapterTests.cs 2010-12-14 20:48:01 +0000
@@ -858,18 +858,11 @@
"field varchar(50) DEFAULT NULL," +
"PRIMARY KEY (id_auto))");
- execSQL("CREATE PROCEDURE sp_insert(" +
- " in p_field varchar(50)) " +
- " BEGIN " +
- " INSERT INTO T(field) VALUES(p_field);" +
- " SELECT * FROM T WHERE id_auto=@@IDENTITY;" +
- " END");
-
MySqlDataAdapter da = new MySqlDataAdapter("SELECT * FROM T", conn);
da.InsertCommand = conn.CreateCommand();
- da.InsertCommand.CommandText = "sp_insert";
- da.InsertCommand.CommandType = CommandType.StoredProcedure;
- da.InsertCommand.Parameters.Add("p_field", MySqlDbType.VarChar, 50, "field");
+ da.InsertCommand.CommandText = @"INSERT INTO T(field) VALUES (@p_field);
+ SELECT * FROM T WHERE id_auto=@@IDENTITY";
+ da.InsertCommand.Parameters.Add("@p_field", MySqlDbType.VarChar, 50, "field");
da.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord;
da.DeleteCommand = conn.CreateCommand();
@@ -885,6 +878,8 @@
table.Rows.Add(r);
da.Update(table);
+ Assert.AreEqual(r.RowState, DataRowState.Unchanged);
+
table.Rows[0].Delete();
r = table.NewRow();
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20101214204801-erjo37a8gui0d9pn.bundle
| Thread |
|---|
| • bzr commit into connector-net-6.0 branch (reggie.burnett:854) Bug#54863Bug#58853 | Reggie Burnett | 14 Dec |