Bug #54570 MySqlHelper.ExecuteReader operation doesn't have overload for MySqlConnection
Submitted: 16 Jun 2010 22:03 Modified: 28 Jun 2010 15:09
Reporter: Travis Duncan Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.2.3.0 OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: .net Connector, MySqlHelper

[16 Jun 2010 22:03] Travis Duncan
Description:
The MySqlHelper object does not have an overloaded version of the ExecuteReader method which accepts a MySqlConnection object (instead of a connectionString string).  To my knowledge all the other "helper methods" have this overload.

How to repeat:
If you code in a similar code block to the one shown below, when you attempt to compile the code you will receive a compile-time error due to there being no implementation of the method.

using (MySqlDataReader reader = MySqlHelper.ExecuteReader(DatabaseConnection, query))
{

      while (reader.Read())
      {

      // Checks to make sure we don't get a NULL localeCode 
      if (reader.IsDBNull(0))
          locales.Add(reader.GetString(0));

      }

}

/* Variable declarations (for the bug report)
List<string> locales;
string query;
MySqlConnection DatabaseConnection; */

Suggested fix:
If possible, an overloaded implementation of the MySqlHelper.ExecuteReader method would be nice.

I've been working around the issue by replacing the beginning of my using block with 

using (MySqlDataReader reader = new MySqlCommand(query, DatabaseConnection).ExecuteReader())
[25 Jun 2010 17:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/112240

819 Reggie Burnett	2010-06-25
      - added public MySqlHelper.ExecuteDataReader method that takes an external connection (bug #54570)
[25 Jun 2010 17:45] Reggie Burnett
Fixed in 6.0.7, 6.1.5, 6.2.4, 6.3.3+
[28 Jun 2010 15:09] Tony Bedford
An entry has been added to the 6.0.7, 6.1.5, 6.2.4, and 6.3.3 changelogs:

The MySqlHelper object did not have an overloaded version of the ExecuteReader method that accepted a MySqlConnection object.