Bug #11386 Numeric parameters with Precision and Scale not taken into account by Connector
Submitted: 16 Jun 2005 14:59 Modified: 17 Jun 2005 6:23
Reporter: Sebastien Lehoux Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.0.6 OS:Windows (Windows 2k)
Assigned to: Reggie Burnett CPU Architecture:Any

[16 Jun 2005 14:59] Sebastien Lehoux
Description:
When trying to call a Stored Procedure with a Parameter of type Numeric that has a Precision of 19 and a scale of 4, the following error is generated:

#42000 Incorrect number of arguments for PROCEDURE  etc.PRC_FindClientsAll; Expected 17, got 16; 

If i remove the precision and scale, the error is no longer generated.

Have not tested if this error is generated with a parameter of type DECIMAL.

How to repeat:
1 - Create a Stored Procedure with a parameter of type NUMERIC with a precision of 19 and a scale of 4.

2 - Access it with MuSQL Connector/NET.
[17 Jun 2005 6:23] Vasily Kishkin
Sorry...but I was not able to reproduce it on 5.0.7. Could you please upgrade your version of mysqld. Test case is attached.
[17 Jun 2005 6:24] Vasily Kishkin
Test case

Attachment: 11368.zip (application/x-zip-compressed, text), 3.86 KiB.

[12 Oct 2005 19:19] Csaba Halasz
Your test case is wrong, because it does not use the StoredProcedure class.
The bug is in that class when it tries to parse the parameter list returned by the server.
You should do something like this to reproduce:
      //  create procedure ppp (d numeric(19,4)) begin end;
	    IDbCommand cmd = conn.CreateCommand();
	    cmd.CommandText = "ppp";
	    cmd.CommandType = CommandType.StoredProcedure;
	    IDataParameter Param = cmd.CreateParameter();
	    Param.ParameterName = "d";
	    Param.DbType = DbType.String;
	    Param.Value = "12345678912345.6455";
	    cmd.Parameters.Add(Param);

      result = cmd.ExecuteNonQuery();
      if (result != 0)
       Console.WriteLine("Error !");

BTW, this seems to be a duplicate of Bug #6902, which is supposedly closed.
[12 Oct 2005 21:32] Sebastien Lehoux
After looking at my code further, i realised the bug was caused by an error of mine, and not the connector. Sorry about that.