Bug #10943 SQL command with decimal parameter causes MySqlException error.
Submitted: 29 May 2005 16:23 Modified: 30 May 2005 5:57
Reporter: Ruxo Zheng Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:1.0.4 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[29 May 2005 16:23] Ruxo Zheng
Description:
Any sql command which contains any decimal parameters cause MySqlException error when executed.

I'm using MySql server version 4.1.12-nt via TCP/IP, running on the same machine.

How to repeat:
Create a table contains a decimal column.  Create MySqlCommand. Set it with an insert command contained the decimal column parameter.  Set the decimal parameter of the command, then executes the command.  The error should occur.

Suggested fix:
The error reports about an invalid character in front of the decimal value.  Tracing the code, I find that the Serialize() function of MySqlDecimal uses WriteLenString(), which is indepedent of "binary"'s value.  Perhap another function should be used in the 'else' section of if-condition instead.
[30 May 2005 5:55] Vasily Kishkin
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in MySQL.
[30 May 2005 5:57] Vasily Kishkin
Ah...I just want to say that we have already a report about this bug. Prevouse message was generated by bug system.