List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:June 25 2010 9:46pm
Subject:bzr commit into connector-net-6.2 branch (reggie.burnett:864)
View as plain text  
#At file:///C:/work/bzr-connector-net/6.2/ based on revid:reggie.burnett@stripped

  864 Reggie Burnett	2010-06-25 [merge]
      merged

    modified:
      CHANGES
      MySql.Data/Provider/Source/NativeDriver.cs
      MySql.Data/Tests/Source/PoolingTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES	2010-06-25 17:43:50 +0000
+++ b/CHANGES	2010-06-25 21:46:56 +0000
@@ -16,6 +16,8 @@
 - improved our procedure caching so that if you drop and recreate a proc with a different number of parameters
   it will find the new proc as long as your are actually using the right number of parameters (bug #52562)
 - added public MySqlHelper.ExecuteDataReader method that takes an external connection (bug #54570)
+- applied patch from 5.x series that reset the connection to the base encoding when doing a 
+  connection reset (bug #47153)
 
 Version 6.2.3
 - fixed InvalidOperationException when accessing Stream.ReadTimeout or Stream.WriteTimeout on CF

=== modified file 'MySql.Data/Provider/Source/NativeDriver.cs'
--- a/MySql.Data/Provider/Source/NativeDriver.cs	2010-06-24 13:27:14 +0000
+++ b/MySql.Data/Provider/Source/NativeDriver.cs	2010-06-25 21:46:56 +0000
@@ -474,6 +474,7 @@
         public void Reset()
         {
             warnings = 0;
+            stream.Encoding = this.Encoding;
             stream.SequenceByte = 0;
             packet.Clear();
             packet.WriteByte((byte)DBCmd.CHANGE_USER);

=== modified file 'MySql.Data/Tests/Source/PoolingTests.cs'
--- a/MySql.Data/Tests/Source/PoolingTests.cs	2010-06-24 13:27:14 +0000
+++ b/MySql.Data/Tests/Source/PoolingTests.cs	2010-06-25 21:46:56 +0000
@@ -506,5 +506,36 @@
                 c2.Close();
             }
         }
+
+        /// <summary>
+        /// Bug #47153	Connector/NET fails to reset connection when encoding has changed
+        /// </summary>
+        [Test]
+        public void ConnectionResetAfterUnicode()
+        {
+            execSQL("CREATE TABLE test (id INT, name VARCHAR(20) CHARSET UCS2)");
+            execSQL("INSERT INTO test VALUES (1, 'test')");
+
+            string connStr = GetPoolingConnectionString() + ";connection reset=true;min pool size=1; max pool size=1";
+            using (MySqlConnection c = new MySqlConnection(connStr))
+            {
+                c.Open();
+                MySqlCommand cmd = new MySqlCommand("SELECT * FROM test", c);
+                using (MySqlDataReader r = cmd.ExecuteReader())
+                {
+                    r.Read();
+                }
+                c.Close();
+
+                try
+                {
+                    c.Open();
+                }
+                finally
+                {
+                    KillConnection(c);
+                }
+            }
+        }
     }
 }


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20100625214656-6jg3us0uxv5uv1zk.bundle
Thread
bzr commit into connector-net-6.2 branch (reggie.burnett:864) Reggie Burnett25 Jun