Bug #27135 MySqlParameterCollection and parameters added with Insert Method
Submitted: 14 Mar 2007 15:06 Modified: 26 Mar 2007 6:17
Reporter: Stefano Leardini Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.0.5 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[14 Mar 2007 15:06] Stefano Leardini
Description:
I have added a couple of parameters to the MySqlParameterCollection using the Insert method. As I can see from the source code these parameters are added to the ArrayList items but not to the Hashtables ciHash and hash. 
If you later try to retrieve these parameters using the ParameterName you can't find them. (with or without the parameter marker added) 

How to repeat:
It's very simple
Insert a parameter to a MySqlCommand in this way: myCmd.Parameters.Insert("?pname"),
then retrieve it using the parameter name
MySqlParameter p = myCmd["?pname"]

Suggested fix:
Some code like the one in Add??
[19 Mar 2007 18:09] 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/22291
[19 Mar 2007 18:11] Reggie Burnett
Fixed in 5.0.6 and 1.0.10
[19 Mar 2007 18:26] Reggie Burnett
Fixed in 5.0.6 and 1.0.10
[26 Mar 2007 6:17] MC Brown
A note has been added to the 1.0.10 and 5.0.6 changelog.