Bug #9739 Need to explicitly handle MYSQL_TYPE_NEWDECIMAL from mysql
Submitted: 8 Apr 2005 0:32 Modified: 17 May 2005 7:52
Reporter: [ name withheld ] Email Updates:
Status: Can't repeat Impact on me:
Category:Connector / NET Severity:S3 (Non-critical)
Version:1.0.4 OS:Microsoft Windows (Windows)
Assigned to: CPU Architecture:Any

[8 Apr 2005 0:32] [ name withheld ]
Connector .NET does not handle the following type in MySqlDbType from MySql:


This is against MySql 5.0.3-beta.

MYSQL_TYPE_NEWDECIMAL gets converted to a MySqlBinary as the BINARY_FLAG (128) is also set for the field.

Column datatype in .NET is System.Byte[].  You can't view the decimal result so this is inconvenient.

Workaround: use MySql function CAST(expr as decimal).

How to repeat:
CREATE TABLE `test`.`tab_precision` (
   `col4` DECIMAL(20,5)
) ENGINE = InnoDB;

insert into test.tab_precision values(5);

select col4 * 2 from test.tab_precision;

column datatype is a blob (System.Byte[])

Suggested fix:
Implement NewDecimal=246 in the MySqlDbType enumeration and use the already existing MySqlDecimal class to represent it.
[17 May 2005 7:52] Vasily Kishkin
I created test suit and tried to repeat the bug.  Column datatype in .NET is System.Double.  Test suit is attached.
[17 May 2005 7:53] Vasily Kishkin
test suit

Attachment: 9739.zip (application/x-zip-compressed, text), 6.48 KiB.