-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 XmlSqlBinaryReader and introduce a corpus of SqlXml tests #81878
Fix XmlSqlBinaryReader and introduce a corpus of SqlXml tests #81878
Conversation
Tagging subscribers to this area: @dotnet/area-system-xml Issue DetailsFixes #74852 As reported in #74852, a regression was introduced that prevents This regression slipped through because we didn't have any test coverage of Many thanks to @WaynePaiMS for finding the root cause of this regression and providing a repro app!
|
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.
Based on your description the change looks good.
src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs
Show resolved
Hide resolved
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.
Looks great, thanks. Given the large number of old tests introduced, may I suggest running the CI pipeline a few times ahead of merging to weed out any potential flakiness?
src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlXmlTest.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlXmlTest.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlXmlTest.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Data.Common/tests/System/Data/SqlTypes/SqlXmlTest.cs
Outdated
Show resolved
Hide resolved
The .bmx binary files are going to be a problem for VMR and source build. @premun Anything you would like to see to be done about them in this PR? |
Thanks for tagging me. For binaries included for test purposes, we let them flow in the VMR and they will get flagged by a binary scan. We can then allow those through this file: https://github.com/dotnet/installer/blob/main/src/VirtualMonoRepo/allowed-binaries.txt So if these fall into the same category, it would be great we added that there by opening a PR against installer. EDIT: That being said, if these could go into |
dotnet/runtime-assets#313 was merged, moving the binary and text xml test files into that repo. I'm converting this PR to a draft until the new I've iterated on the other feedback though as well, and the tests are more robust/meaningful now. Those changes can be reviewed at your convenience, @stephentoub. |
b69923b
to
fda630a
Compare
fda630a
to
030ba31
Compare
@carlossanlop Heads-up that once this is merged, I'll be pursuing backports to |
Sounds good, @jeffhandley, thanks for the heads up. If we want this in the March Servicing Release, this needs to be merged before EOD tomorrow Monday 13th, which is the Code Complete date. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Failures are unrelated:
|
…#81878) * Fix XmlSqlBinaryReader and introduce a corpus of SqlXml tests * Revert solution file changes made by VS * Use runtime-assets test files for Text and SQL Binary XML tests * Remove System.Data.Common.TestData package reference * Reference the System.Data.Common.TestData package for SqlXml tests * Add System.Common.Data.TestData to Version.Details.xml for automated dependency flow
…#81878) * Fix XmlSqlBinaryReader and introduce a corpus of SqlXml tests * Revert solution file changes made by VS * Use runtime-assets test files for Text and SQL Binary XML tests * Remove System.Data.Common.TestData package reference * Reference the System.Data.Common.TestData package for SqlXml tests * Add System.Common.Data.TestData to Version.Details.xml for automated dependency flow
#82063) * Fix XmlSqlBinaryReader and introduce a corpus of SqlXml tests * Revert solution file changes made by VS * Use runtime-assets test files for Text and SQL Binary XML tests * Remove System.Data.Common.TestData package reference * Reference the System.Data.Common.TestData package for SqlXml tests * Add System.Common.Data.TestData to Version.Details.xml for automated dependency flow
#82062) * Fix XmlSqlBinaryReader and introduce a corpus of SqlXml tests * Revert solution file changes made by VS * Use runtime-assets test files for Text and SQL Binary XML tests * Remove System.Data.Common.TestData package reference * Reference the System.Data.Common.TestData package for SqlXml tests * Add System.Common.Data.TestData to Version.Details.xml for automated dependency flow
Fixes #74852
As reported in #74852, a regression was introduced in .NET 6 with #43379 that prevents
SqlXml.CreateReader()
from properly processing SQL Binary XML content (see MS-BINXML). The regression is caused by seeking beyond the end of the current token when validating the token, due to a simple mistake of using_end
instead of_pos
when_end
represents the end of the buffer and_pos
represents the position 1 byte beyond the end of the current token.This regression slipped through because we didn't have any test coverage of
SqlXml.CreateReader()
that hit the code path of using theXmlSqlBinaryReader
; all tests were text-based and using theXmlTextReader
implementation. This PR introduces a corpus of test files resurrected from the .NET Framework tests (that had not been previously ported over), and each test is validated through both SQL Binary XML and Text formats.Many thanks to @WaynePaiMS for finding the root cause of this regression and providing a repro app!