Bug #10152 syntax error using decimal parameter in where clause
Submitted: 25 Apr 2005 19:37 Modified: 25 Jun 2005 20:48
Reporter: Thiago Aburaya
Status: Closed
Category:Connector/Net Severity:S2 (Serious)
Version:5.0.3 OS:Microsoft Windows (Windows XP)
Assigned to: Reggie Burnett Target Version:

[25 Apr 2005 19:37] Thiago Aburaya
Description:
 A syntax error (#42000) is returned when trying to use a decimal parameter
in a select query.

I looked at the Serialize method of MySqlDecimal class and it
writes one byte to inform the server the length of the decimal value
followed by the value itself.

I'm new to MySQL but I believe the error is either caused by this serialization format or
by a server error when parsing the query.

How to repeat:
create a table (t1) with 2 fields : f1 (int) and f2 (decimal).
create a .NET application and try to open a datareader
using the following statement : "select * from t1 where f2 = ?f2 "
and of course using a parameter of type MySqlDecimal.
[17 May 2005 10:34] Vasily Kishkin
Tested on Win 2000 Sp4, Microsoft Visual C# .NET , Connector .NET 1.0.4 Test case is
attached.
[17 May 2005 10:35] Vasily Kishkin
test program

Attachment: 10152.zip (application/x-zip-compressed, text), 6.51 KiB.

[24 Jun 2005 22:47] 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 fixed as a result of fixing a different bug.  The fix is in 1.0.5
[25 Jun 2005 20:48] Mike Hillyer
Documented in 1.0.5 changelog.