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

  957 Reggie Burnett	2011-02-14 [merge]
      merged

    modified:
      MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs
      MySql.Data/Provider/Source/common/StreamCreator.cs
      MySql.Data/Tests/Source/ConnectionStringBuilder.cs
=== modified file 'MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs'
=== modified file 'MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs'
--- a/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs	2010-11-03 21:04:38 +0000
+++ b/MySql.Data/Provider/Source/MySqlConnectionStringBuilder.cs	2011-02-14 21:14:52 +0000
@@ -763,6 +763,20 @@
             return new Regex(BlobAsUTF8ExcludePattern);
         }
 
+        public override bool ContainsKey(string keyword)
+        {
+            try
+            {
+                object value;
+                ValidateKeyword(keyword);
+                return values.TryGetValue(validKeywords[keyword], out value);
+            }
+            catch (Exception)
+            {
+                return false;
+            }
+        }
+
         public override object this[string keyword]
         {
             get { return values[validKeywords[keyword]]; }

=== modified file 'MySql.Data/Provider/Source/common/StreamCreator.cs'
--- a/MySql.Data/Provider/Source/common/StreamCreator.cs	2011-01-06 16:33:06 +0000
+++ b/MySql.Data/Provider/Source/common/StreamCreator.cs	2011-02-14 21:14:07 +0000
@@ -188,7 +188,7 @@
 
 			Socket socket = unix ?
 				new Socket(AddressFamily.Unix, SocketType.Stream, ProtocolType.IP) :
-				new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+				new Socket(ip.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
             if (keepalive > 0)
             {
                 SetKeepAlive(socket, keepalive);

=== modified file 'MySql.Data/Tests/Source/ConnectionStringBuilder.cs'
--- a/MySql.Data/Tests/Source/ConnectionStringBuilder.cs	2010-08-18 19:48:34 +0000
+++ b/MySql.Data/Tests/Source/ConnectionStringBuilder.cs	2011-02-14 21:13:40 +0000
@@ -116,5 +116,20 @@
             Assert.IsFalse(s.UseCompression);
             Assert.IsTrue(s.Pooling);
         }
+
+        /// <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"));
+        }
     }
 }

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-trunk branch (reggie.burnett:957) Reggie Burnett14 Feb