List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:February 14 2011 9:11pm
Subject:bzr commit into connector-net-6.0 branch (reggie.burnett:860) Bug#59835
Bug#11766671
View as plain text  
#At file:///C:/Users/Reggie/work/connector-net/6.0/ based on revid:reggie.burnett@stripped

  860 Reggie Burnett	2011-02-14
      - fixed MySqlConnectionStringBuilder.ContainsKey to return true for any alternative versions
        of a keyword (MySQL bug #59835, Oracle bug #11766671)

    modified:
      CHANGES
      MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs
      MySql.Data/Tests/Source/ConnectionStringBuilder.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2011-02-14 19:20:39 +0000
+++ b/CHANGES	2011-02-14 21:11:26 +0000
@@ -24,6 +24,8 @@
   (MySQL bug #59537, Oracle bug #11766433)
 - fixed bug that prevented setting the membershipprovider's ApplicationName property at runtime
   (MySQL bug #59438, Oracle bug #11770465)
+- fixed MySqlConnectionStringBuilder.ContainsKey to return true for any alternative versions
+  of a keyword (MySQL bug #59835, Oracle bug #11766671)
 
 Version 6.0.7
 - Fix authorization popup after modifying stored procedure in VS (Bug #44715)

=== modified file 'MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs'
--- a/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs	2009-08-04 20:44:43 +0000
+++ b/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs	2011-02-14 21:11:26 +0000
@@ -1062,6 +1062,19 @@
             return connStr.Remove(connStr.Length - 1, 1);
         }
 
+        public override bool ContainsKey(string keyword)
+        {
+            try
+            {
+                Keyword kw = GetKey(keyword);
+                return GetValue(kw) != null;
+            }
+            catch (Exception)
+            {
+                return false;
+            }
+        }
+
         /// <summary>
         /// Clears the contents of the <see cref="MySqlConnectionStringBuilder"/> instance. 
         /// </summary>

=== modified file 'MySql.Data/Tests/Source/ConnectionStringBuilder.cs'
--- a/MySql.Data/Tests/Source/ConnectionStringBuilder.cs	2009-08-04 20:44:43 +0000
+++ b/MySql.Data/Tests/Source/ConnectionStringBuilder.cs	2011-02-14 21:11:26 +0000
@@ -96,5 +96,20 @@
             s["database"] = "test2";
             Assert.AreEqual("database=test2", s.ConnectionString);
         }
+
+        /// <summary>
+        /// Bug #59835	.Net Connector MySqlConnectionStringBuilder wrong result ContainsKey function
+        /// </summary>
+        [Test]
+        public void ContainsKey()
+        {
+            MySqlConnectionStringBuilder s = new MySqlConnectionStringBuilder();
+            s["database"] = "test";
+            Assert.IsTrue(s.ContainsKey("initial catalog"));
+            s["server"] = "myserver";
+            Assert.IsTrue(s.ContainsKey("server"));
+            Assert.IsTrue(s.ContainsKey("host"));
+            Assert.IsFalse(s.ContainsKey("badkey"));
+        }
     }
 }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110214211126-ed9begl2n3izxnal.bundle
Thread
bzr commit into connector-net-6.0 branch (reggie.burnett:860) Bug#59835Bug#11766671Reggie Burnett14 Feb