Double.MinValue insertion into MySQL DOUBLE column
When inserting Double.MinValue from VB.NET into a MySQL (8.X or 9.3) DOUBLE column (X), the operation fails with:
Out of range value for column 'X' at row N
Details:
- Z.BulkOperations v2.13.15.
- The DataRow value is correct (Double.MinValue = -1.7976931348623157E+308).
- Z.BulkOperations converts the Double to a string literal internally to generate the SQL.
- On x64 platforms, the conversion truncates the precision slightly (e.g., -1.79769313486232E+308).
- MySQL rejects the truncated literal as out of range, even though the original value is valid.
- On x86 platforms, the same literal is accepted by MySQL.
- Changing CultureInfo has no effect; the problem is due to internal Double.ToString() conversion in the library.
Thanks for the help. Kind Regards Marin
Hello @mpriala-code,
Could you try the latest version and let us know if this issue still occurs?
The version you’re using dates back to 2018. Many issues have been fixed over the past seven years, and this one is likely already resolved if it’s the one we think it is.
Best Regards,
Jon
Yes, this is the result:
- Z.BulkOperations v5.2.4.
- The LogDump:
- -- @150_5: -1.79769313486232E+308 (Type = Double, Size = 22)
- App in 64
Best regards. Marin.
Hello @mpriala-code,
Could you create a small runnable project that reproduces the issue? It doesn’t have to be your actual project—just a new solution with the minimum code. If possible, please include your my.ini (or relevant DB configuration), as that could help.
My developer tested both of your reported issues, and both worked correctly on our side.
You can send the project privately to [email protected].
Best Regards,
Jon
Hello @JonathanMagnan
As well as with the Issue #81, we've just sent you a sample code that crashes. Also tried with the latest version (trial) and still same issue.
Thanks for the support.
Best regards, Marin