Bug #12646 Parameters are defaulted to Decimal
Submitted: 18 Aug 2005 14:13 Modified: 18 Aug 2005 20:19
Reporter: Paul Wilson Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:v1.04 OS:Windows (Win XP)
Assigned to: Reggie Burnett CPU Architecture:Any

[18 Aug 2005 14:13] Paul Wilson
Description:
The constructor for MySqlParameter that accepts parameterName and value is the only place that SetTypeFromValue is called -- this is not enough.  Many of us use the generic interfaces and call CreateParameter on the command object -- and then we set the name and value and add the parameter to the parameter collection of the command object.  This approach works with the MS Sql and Oracle providers, and seems to work with other providers also, but the MySql provider ends up defaulting the parameter type to Decimal in this case.  It should  instead call the SetTypeFromValue when the parameter is added to the collection if the type was not explicitly set -- or you should default your type specifically to String instead of Decimal at least, which is what I believe other providers are doing.

How to repeat:
See description.

Suggested fix:
It should  instead call the SetTypeFromValue when the parameter is added to the collection if the type was not explicitly set -- or you should default your type specifically to String instead of Decimal at least, which is what I believe other providers are doing.
[18 Aug 2005 20:19] 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

Additional info:

This was reported earlier and has been fixed in 1.0.5 which should be out RSN