Skip to content

Fix sequential text reader bug and add covering test #3383

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Wraith2
Copy link
Contributor

@Wraith2 Wraith2 commented May 28, 2025

Fixes #3361

When using single byte input the test provided triggered a condition where the next read would skip data in available internal buffer because it was exactly, and not less than, the required amount.

/cc @m0a0k0s

@mdaigle
Copy link
Contributor

mdaigle commented May 29, 2025

/azp run

mdaigle
mdaigle previously approved these changes May 29, 2025
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

benrr101
benrr101 previously approved these changes May 29, 2025

StringBuilder resultBuilder = new StringBuilder();
CancellationTokenSource cts = new CancellationTokenSource();
using (var connection = new SqlConnection(DataTestUtility.TCPConnectionString))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More curiosity than request: for unit tests, I'm usually more liberal with usage of using statements vs blocks, so I'm wondering if your preference for the blocks is to trigger a disposal before running assertions or if behavior has no impact here and it's just a style preference.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Purely style. It would work with blocks the same way as with statements. I learnt c# at the first version and there are some newer idioms that I simply prefer not to use. In general I like to have very clear scoped blocks to help me visually understand what's in and out of scope.

@Wraith2 Wraith2 dismissed stale reviews from benrr101 and mdaigle via 5dce7ba May 30, 2025 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SqlSequentialTextReader ReadAsync returns 0 before the end of a file
3 participants