#At file:///C:/work/connector-net/6.3/ based on revid:reggie.burnett@stripped
949 Reggie Burnett 2010-11-30
- fixed MySqlHelper.ExecuteReader bug where it was opening the connection inside a using block
which was closing the connection before we were really done with it (bug #57501)
modified:
CHANGES
MySql.Data/Provider/Source/MySqlHelper.cs
MySql.Data/Tests/Source/CommandTests.cs
=== modified file 'CHANGES'
=== modified file 'CHANGES'
--- a/CHANGES 2010-11-30 18:33:23 +0000
+++ b/CHANGES 2010-11-30 18:44:43 +0000
@@ -12,6 +12,8 @@
- fixed our DDEX code so that dragging tables from server explorer onto a typed data set
preserves the table name (bug #57894)
- fixed ReadFieldLength to return a long so bigint autoincrement columns can work (bug #58373)
+- fixed MySqlHelper.ExecuteReader bug where it was opening the connection inside a using block
+ which was closing the connection before we were really done with it (bug #57501)
Version 6.3.5
- Fix installer bug related to .NET FW 4.0 (bug #56580)
=== modified file 'MySql.Data/Provider/Source/MySqlHelper.cs'
--- a/MySql.Data/Provider/Source/MySqlHelper.cs 2010-09-17 16:24:05 +0000
+++ b/MySql.Data/Provider/Source/MySqlHelper.cs 2010-11-30 18:44:43 +0000
@@ -298,13 +298,11 @@
public static MySqlDataReader ExecuteReader(string connectionString, string commandText, params MySqlParameter[] commandParameters)
{
//create & open a SqlConnection
- using (MySqlConnection cn = new MySqlConnection(connectionString))
- {
- cn.Open();
+ MySqlConnection cn = new MySqlConnection(connectionString);
+ cn.Open();
- //call the private overload that takes an internally owned connection in place of the connection string
- return ExecuteReader(cn, null, commandText, commandParameters, false);
- }
+ //call the private overload that takes an internally owned connection in place of the connection string
+ return ExecuteReader(cn, null, commandText, commandParameters, false);
}
/// <summary>
=== modified file 'MySql.Data/Tests/Source/CommandTests.cs'
--- a/MySql.Data/Tests/Source/CommandTests.cs 2010-10-07 21:26:37 +0000
+++ b/MySql.Data/Tests/Source/CommandTests.cs 2010-11-30 18:44:43 +0000
@@ -449,6 +449,21 @@
Assert.AreEqual("B", reader.GetString(3));
}
}
+
+ /// <summary>
+ /// Bug #57501 MySql Connector/NET 6.3.5.0 fails to read from DataReader
+ /// </summary>
+ [Test]
+ public void HelperTest()
+ {
+ string connStr = GetConnectionString(true);
+ using (MySqlDataReader reader = MySqlHelper.ExecuteReader(connStr, "SHOW TABLES"))
+ {
+ while (reader.Read())
+ {
+ }
+ }
+ }
}
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20101130184443-yd3en92bpbcgjdq5.bundle
| Thread |
|---|
| • bzr commit into connector-net-trunk branch (reggie.burnett:949) Bug#57501 | Reggie Burnett | 30 Nov |