List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:December 14 2010 11:03pm
Subject:bzr commit into connector-net-6.1 branch (reggie.burnett:869)
View as plain text  
#At file:///C:/Documents%20and%20Settings/Reggie/work/connector-net/6.1/ based on revid:reggie.burnett@stripped

  869 Reggie Burnett	2010-12-14 [merge]
      merged

    modified:
      CHANGES
      MySql.Data/Provider/Source/common/MySqlTokenizer.cs
      MySql.Data/Provider/Source/dataadapter.cs
      MySql.Data/Tests/Source/DataAdapterTests.cs
      MySql.Web/Providers/Source/MembershipProvider.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2010-12-14 15:14:30 +0000
+++ b/CHANGES	2010-12-14 23:03:40 +0000
@@ -16,6 +16,10 @@
   (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)
+- fixed unnecessary string code in MySqlTokenizer (bug #58757)
+- fixed MembershipProvider to properly set a hash key when using a keyed hash alogrithm (bug #58906)
 
 Version 6.1.5
 - Fix authorization popup after modifying stored procedure in VS (Bug #44715)

=== modified file 'MySql.Data/Provider/Source/common/MySqlTokenizer.cs'
--- a/MySql.Data/Provider/Source/common/MySqlTokenizer.cs	2010-08-18 19:03:33 +0000
+++ b/MySql.Data/Provider/Source/common/MySqlTokenizer.cs	2010-12-14 23:03:40 +0000
@@ -147,7 +147,6 @@
             while (FindToken())
             {
                 if ((stopIndex - startIndex) < 2) continue;
-                string token = sql.Substring(startIndex, stopIndex - startIndex).Trim();
                 char c1 = sql[startIndex];
                 char c2 = sql[startIndex+1];
                 if (c1 == '?' ||

=== modified file 'MySql.Data/Provider/Source/dataadapter.cs'
--- a/MySql.Data/Provider/Source/dataadapter.cs	2010-10-07 21:11:14 +0000
+++ b/MySql.Data/Provider/Source/dataadapter.cs	2010-12-14 23:03:40 +0000
@@ -181,19 +181,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-08-18 19:03:33 +0000
+++ b/MySql.Data/Tests/Source/DataAdapterTests.cs	2010-12-14 23:03:40 +0000
@@ -860,18 +860,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();
@@ -887,6 +880,8 @@
             table.Rows.Add(r);
             da.Update(table);
 
+            Assert.AreEqual(r.RowState, DataRowState.Unchanged);
+
             table.Rows[0].Delete();
 
             r = table.NewRow();

=== modified file 'MySql.Web/Providers/Source/MembershipProvider.cs'
--- a/MySql.Web/Providers/Source/MembershipProvider.cs	2010-08-18 19:03:33 +0000
+++ b/MySql.Web/Providers/Source/MembershipProvider.cs	2010-12-14 23:03:40 +0000
@@ -1227,9 +1227,15 @@
         /// </summary>
         /// <param name="bytes"></param>
         /// <returns></returns>
-        private string HashPasswordBytes(byte[] bytes)
+        private string HashPasswordBytes(byte[] key, byte[] bytes)
         {
             HashAlgorithm hash = HashAlgorithm.Create(Membership.HashAlgorithmType);
+
+            if (hash is KeyedHashAlgorithm)
+            {
+                KeyedHashAlgorithm keyedHash = hash as KeyedHashAlgorithm;
+                keyedHash.Key = key;
+            }
             return Convert.ToBase64String(hash.ComputeHash(bytes));
         }
 
@@ -1253,7 +1259,7 @@
                 return Convert.ToBase64String(encryptedBytes);
             }
             else if (format == MembershipPasswordFormat.Hashed)
-                return HashPasswordBytes(keyedBytes);
+                return HashPasswordBytes(keyBytes, keyedBytes);
             else
                 throw new ProviderException(Resources.UnsupportedPasswordFormat);
         }

No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).
Thread
bzr commit into connector-net-6.1 branch (reggie.burnett:869) Reggie Burnett15 Dec