-
Notifications
You must be signed in to change notification settings - Fork 286
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
Fix bug with LegacyRowVersionNullBehavior #1182
Conversation
Can you add the covering tests the user provided please. |
What should the new behaviour be for |
Addressed that too. |
Ok, I'm fine with returning null for NULL there, just wondering singl ei was converting the new tests for the current behaviour to make sure it was well defined. I think I prefer my goto fix code better but I'm fine with approving this version if you prefer it. |
I decided to revert this back to throw exception - as ideally this is "expected" with the breaking change we have when
I don't mind yours either, the one I have now is a less impactful and less complex to understand.. I'll leave it as is. |
My only complaint is that the goto version avoids checking the same variable twice. On each path you only check what is needed. In the if-based construction you have to access the legacy switch twice and use isnull twice. If you and the team prefer this version for code clarity that's ok though. |
LGTM, plus I liked the approach to C# 9's new features. |
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.
Could you extend the tests and include Timestamp
too?
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderTest.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataReaderTest/DataReaderTest.cs
Outdated
Show resolved
Hide resolved
Timestamp is already included when we run this query in tests: I'll take care of other improvements. |
Backporting dotnet#1182 for 3.0.1-servicing
Should this be considered for backporting to 3.0.1? |
@roji most important if 3.0 is LTS, I guess? |
@ErikEJ I think it isn't though, no? Isn't 4.0 the LTS? |
This is one of the candidates for backporting to 3.0.1. |
* Fix Async thread blocking on SqlConnection open for AAD modes Backporting #1182 for 3.0.1-servicing * Adding missed TdsParser.cs from Bacporting 1182 issue.
Fixes #1175 as reported.