Bug #61077 unsigned BIGINT is mapped to decimal instead of unsigned long (Entity Framework)
Submitted: 6 May 2011 8:20 Modified: 12 May 2011 15:55
Reporter: Markus Wolters Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.3.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: BIGINT, decimal, entity framework, UNSIGNED

[6 May 2011 8:20] Markus Wolters
Description:
The MySQL Datatype UNSIGNED BIGINT is mapped to "decimal" when generating entity model. It should be mapped to "unsigned long", because BIGINT (Signed) ist correctly mapped to "long". 

How to repeat:
1. Create a table with a column of type "BIGINT" and a table of type "BIGINT UNSIGNED".
2. Generate ADO.NET Entity model out of database with this table.
3. Column of MySQL type "BIGINT" is mapped to "long".
3. Column of MySQL type "BIGINT UNSIGNED" is mapped to "decimal".

Suggested fix:
"BIGINT UNSIGNED" should be mapped to "unsigned long".
[12 May 2011 15:55] Reggie Burnett
Entity Framework doesn't support unsigned data types however MySQL does.  So internally we have to map MySQL unsigned data type to the smallest signed EF data type that can contain the data.  For an unsigned bigint, that it is a signed decimal type.
[20 Jun 2016 12:12] Jianfeng Luo
The problem is unsigned Bigint is mapped to decimal, but decimal is NOT mapped back to unsigned bigint when we save the data. Caused so much agony.