Bug #39734 | Serial converts to int32 as datatype in datatable-column | ||
---|---|---|---|
Submitted: | 29 Sep 2008 18:16 | Modified: | 2 Oct 2008 6:39 |
Reporter: | jaap slootweg | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S2 (Serious) |
Version: | 5.2.3 | OS: | Windows (XP) |
Assigned to: | CPU Architecture: | Any |
[29 Sep 2008 18:16]
jaap slootweg
[1 Oct 2008 6:44]
Tonci Grgin
Hi Jaap and thanks for your report. I will think about it a bit more but I don't see a bug here according to http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html: All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.
[1 Oct 2008 7:29]
jaap slootweg
Dear Tonci, Thank you for looking into it. Can I stress that this is not doing any math, one unsigned bigint is interpreted as uint64 the other as int32. I want to relate the two, and for that they need to be the same datatype in the dataset. Good luck! Jaap
[2 Oct 2008 6:39]
Tonci Grgin
Japp: Can I stress that this is not doing any math, one unsigned bigint is interpreted as uint64 the other as int32. I want to relate the two, and for that they need to be the same datatype in the dataset." If you take a look at debugger you'll see that even on Ln. 535 in datareader.cs type is correct (UINT64), but after ds.Load it isn't. Now, what could be different in your sample ("relate the two")? The difference is in AUTO_INCREMENT attribute. VS can not handle UNIT64 being autoincrement as MSSQL server doesn't support that. This is a common problem with MS tools, they only support what they have with no regards to the rest of the world. This can be proven very easy, just put BIGINT filed only in test table like this: CREATE TABLE bug39734 (TestID BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); and you'll see it also miraculously changing type to UINT32. In .xsd you will see that DataType of TestID *is* System.UInt64 but that's only true as long as AutoIncrement is FALSE. Click on AutoIncrement property and you'll see description I wrote above. Closing the report as this is not a bug in MySQL software.