MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:rburnett Date:November 29 2006 4:53pm
Subject:Connector/NET commit: r469 - in trunk: . mysqlclient/core
View as plain text  
Modified:
   trunk/CHANGES
   trunk/mysqlclient/core/MySqlStream.cs
   trunk/mysqlclient/core/NativeDriver.cs
Log:
Bug #23687 Deleting a connection to a disconnected server causes a failed assertion 

This bug was caused by not catching all cases in MySqlStream that could generate an IOException

Modified: trunk/CHANGES
===================================================================
--- trunk/CHANGES	2006-11-27 17:13:45 UTC (rev 468)
+++ trunk/CHANGES	2006-11-29 16:53:05 UTC (rev 469)
@@ -1,5 +1,9 @@
 Version 5.0.3
 
+  Bugs fixed
+  ----------
+  Bug #23687 Deleting a connection to a disconnected server causes a failed assertion 
+
   Other changes
   -------------
   SSL now working.  [Thanks Alessandro Muzzetta]
@@ -14,7 +18,9 @@
   Bug #23758 Unable to connect to any server - IPv6 related 
   Bug #22882 Registry key 'Global' access denied 
   Bug #18186 Problem with implementation of PreparedStatement  
-
+  Bug #23657 Column names with accented characters were not parsed properly causing malformed column names in result sets.
+  Bug #16126 Connector/NET did not work as a data source for the SqlDataSource object used by ASP.NET 2.0.
+ 
   Other changes
   -------------
   Increased speed of MySqlParameterCollection.IndexOf(string) orders of magnitude

Modified: trunk/mysqlclient/core/MySqlStream.cs
===================================================================
--- trunk/mysqlclient/core/MySqlStream.cs	2006-11-27 17:13:45 UTC (rev 468)
+++ trunk/mysqlclient/core/MySqlStream.cs	2006-11-29 16:53:05 UTC (rev 469)
@@ -73,14 +73,16 @@
 			: this(encoding)
 		{
 			baseStream = baseStr;
-			outStream = new BufferedStream(baseStream);
-			inStream = new BufferedStream(baseStream);
+            inStream = new BufferedStream(baseStream);
+            outStream = new BufferedStream(baseStream);
 		}
 
 		public void Close()
 		{
 			inStream.Close();
-			outStream.Close();
+            // no need to close outStream because closing
+            // inStream closes the underlying network stream
+            // for us.
 		}
 
 		#region Properties
@@ -438,14 +440,22 @@
 				bufferStream.SetLength(0);
 				bufferStream.Position = 0;
 			}
-			outStream.Flush();
-			if (baseStream is CompressedStream)
-			// we do a flush on the basestream here because we might be sitting on top of
-			// a compression stream and calling flush on the BufferedStream doesn't always
-			// call flush on the underlying stream.
-				baseStream.Flush();
-		}
 
+            try
+            {
+                outStream.Flush();
+                if (baseStream is CompressedStream)
+                    // we do a flush on the basestream here because we might be sitting on top of
+                    // a compression stream and calling flush on the BufferedStream doesn't always
+                    // call flush on the underlying stream.
+                    baseStream.Flush();
+            }
+            catch (IOException ioex)
+            {
+                throw new MySqlException(Resources.WriteToStreamFailed, true, ioex);
+            }
+        }
+
 		#endregion
 
 		#region Integer methods

Modified: trunk/mysqlclient/core/NativeDriver.cs
===================================================================
--- trunk/mysqlclient/core/NativeDriver.cs	2006-11-27 17:13:45 UTC (rev 468)
+++ trunk/mysqlclient/core/NativeDriver.cs	2006-11-29 16:53:05 UTC (rev 469)
@@ -449,15 +449,23 @@
 
 		public override void Close()
 		{
-			if (isOpen)
-			{
-				ExecuteCommand(DBCmd.QUIT, null, 0);
-			}
+            try
+            {
+                if (isOpen)
+                {
+                    ExecuteCommand(DBCmd.QUIT, null, 0);
+                }
 
-			if (stream != null)
-				stream.Close();
-			stream = null;
-			base.Close();
+                if (stream != null)
+                    stream.Close();
+                stream = null;
+                base.Close();
+            }
+            catch (Exception)
+            {
+                // we are just going to eat any exceptions
+                // generated here
+            }
 		}
 
 

Thread
Connector/NET commit: r469 - in trunk: . mysqlclient/corerburnett29 Nov