Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
using (var reader = new MySqlCommand("select 1 / 3 from tablename", conn).ExecuteReader())
reader.GetDouble(0); // InvalidCastException
reader.GetFloat(0); // InvalidCastException
The text was updated successfully, but these errors were encountered:
MySqlConnector currently only performs a small number of known "safe" conversions; see #481 and #406.
Note that a decimal column can be retrieved as an int (#54) so it may make sense to allow implicit conversion to float/double (which would be less lossy).
Like similar issues, this needs testing in AdoNetApiTest first.
Sorry, something went wrong.
Added to AdoNetApiTest: mysql-net/AdoNetApiTest@2a48acc
Conversions from a decimal column (or implicit decimal result) will be handled automatically by GetDouble and GetFloat.
Fix shipped in 0.57.0-rc1.
No branches or pull requests