Bug #5613 Bug in MySqlConnection(string, MySqlConnection, MySqlTransaction) constructor
Submitted: 16 Sep 2004 16:52 Modified: 28 Sep 2004 9:17
Reporter: Svetoslav Milenov Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version: OS:
Assigned to: Reggie Burnett

[16 Sep 2004 16:52] Svetoslav Milenov
Description:
MySqlConnection(string, MySqlConnection, MySqlTransaction)  constructor does not invoke this() constructor, so Parameters collection and other stuff is not initialized.

How to repeat:
See code.

Suggested fix:
public MySqlCommand(string cmdText, MySqlConnection connection, MySqlTransaction txn) : this(cmdText, connection)
{
	curTransaction	= txn;
}

P.S. I would modify (string, connection) constructor as well (best practises):

public MySqlCommand(string cmdText, MySqlConnection connection) : this(cmdText)
{
	Connection = connection;
	parameters.ParameterMarker = connection.ParameterMarker;
}

Cheers
[28 Sep 2004 9:17] Reggie Burnett
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html