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

  887 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:47:41 +0000
+++ b/CHANGES	2010-06-25 21:48:06 +0000
@@ -9,6 +9,8 @@
   Fix timeout handling to handle both error codes in the same fashion (bug #53357)
 - changed installer code to skip over config folders that do not contain a machine.config (bug #52352)
 - 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.3.2 (beta 1)
 - added feature where sql queries that are longer than 300 chars are normalized and a new

=== modified file 'MySql.Data/Provider/Source/NativeDriver.cs'
--- a/MySql.Data/Provider/Source/NativeDriver.cs	2010-06-24 13:28:28 +0000
+++ b/MySql.Data/Provider/Source/NativeDriver.cs	2010-06-25 21:48:06 +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-20100625214806-epkfpfj1o4m19jw8.bundle
Thread
bzr commit into connector-net-trunk branch (reggie.burnett:887) Reggie Burnett25 Jun