-
Notifications
You must be signed in to change notification settings - Fork 292
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
NullReferenceException when streaming XML asynchronously from DB #1903
Comments
Hi @NickKerensky, thanks for reporting this issue and providing the sample repro code snippet. It sounds like a regression that might be caused by one of our changes in the release. We'll do some investigation and get back to you soon. |
From the stack trace this looks like code I've been very involved with. Do you want me to have a look @lcheunglci ? |
Thanks @Wraith2, your help would be much appreciated. :) |
Simple fix, just need to add a |
Thanks @Wraith2! |
@Wraith2 , @lcheunglci Anyone have an idea when a hotfix will be released? We are currently experiencing the same NRE. Is it possible to have something published before 5.2.0? |
No idea. you could use the artifacts from the PR if you want. |
Hi @udlose, since MDS 5.1 is an LTS release, we would expect a hotfix release with this fix included in the near future. However, I don't have the exact date at the moment as we're in the middle of planning for the first half of the year. Once we have a concrete date, we'll let you know, but as @Wraith2 mentioned, you can use the artifacts from the PR at the moment. |
We currently don't have a schedule for a 5.1.1 hotfix release; however, depending on the number of bugs and severity, it could happen within a month or 2. |
In our environment we frequently stream XML columns from the database using a pattern similar to the one in the repro test case.
After upgrading to Microsoft.Data.SqlClient 5.1.0, we're getting NullReferenceExceptions for code that was previously working.
To reproduce
This is the simplest test case I could build for the error we're seeing. It's the same:
If you downgrade SqlClient to 5.0.1 you will get the expected result; otherwise there's a NullReferenceException. Applying one of the HACK: lines below will usually provide the expected result with 5.1.0, but not always. (e.g. We've seen process hangs after using the IsDBNullAsync workaround.)
Expected behavior
Prints the test XML string to the console.
Further technical details
Microsoft.Data.SqlClient version: 5.1.0
.NET target: .NET 6.0, .NET 7.0
SQL Server version: Azure SQL, SQL Server 2017
Operating system: Windows 2019, Windows 10 21H2, Ubuntu 22.04
The text was updated successfully, but these errors were encountered: