-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
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? Sign in to your account
Query: Read Avg/Min/Max as nullable from database to throw exception … #18971
Conversation
…only when it is empty Resolves #18955
Description Customer Impact How found Test coverage Regression? Risk |
@Pilchie FYI, we would like to patch this in 3.1.1. |
What workaround is available to the customer, if any? |
@Pilchie Having a workaround may not help much in this case. The issue is that if you are calculating the max of a set of values, then your application may work fine until the result happens to be zero at which point the app will crash. To use a workaround you would have to know that the issue exists, which is very easily missed here, even with reasonable testing. |
@@ -55,6 +56,10 @@ protected override RelationalTypeMapping Clone(RelationalTypeMappingParameters p | |||
/// The generated string. | |||
/// </returns> | |||
protected override string GenerateNonNullSqlLiteral(object value) | |||
=> ((float)value).ToString("R", CultureInfo.InvariantCulture); | |||
{ | |||
var floatValue = Convert.ToSingle(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep as lambda body
PR Feedback
…only when it is empty
Resolves #18955