-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Silent Exception in QueryFirstOrDefaultAsync<T> / QueryFirstOrDefault (MS SQL) #2077
Comments
That's very interesting. I thought we'd handled all these nuances, hence the loop, but if we need an inner loop too: I'm fine with it. I'll investigate, thanks for the report. |
#1834 seems to be related |
Findings:
Running an arbitrary number of additional read operations is not viable - we'd have no way of picking the number. It seems likely that the only way to make this predictable would be to disable |
I'm going to stay active with this on the SqlClient side, but this seems like a provider bug rather than a Dapper bug. The conversation is getting quite lively:) Will reopen if that conversation fizzles without a conclusion. |
We encountered an issue where an SQL error within a stored procedure did not result in an exception being thrown in C#. (MSSQL Server 2022)
I have condensed it into this query:
I would expect an exception to be thrown due to the SQL error in the script, which occurs after attempting to assign an incorrect datatype:
SET @intvar = 'A'
.Instead, the selected value is returned without any errors or exceptions.
By modifying the method
async Task<T> QueryRowAsync<T>(this IDbConnection cnn, Row row, Type effectiveType, CommandDefinition command)
inSqlMapper.Async.cs
, I successfully triggered the SQL exception.Dapper/Dapper/SqlMapper.Async.cs
Line 505 in 2fa046c
Of course, spamming read-calls is not an adequate fix, but it could serve as a starting point for a possible solution.
The text was updated successfully, but these errors were encountered: