Skip to content

ArgumentNullException when reading empty/null PLP strings with new async behavior#3884

Draft
SimonCropp wants to merge 4 commits intodotnet:mainfrom
SimonCropp:ArgumentNullException-when-reading-empty/null-PLP-strings-with-new-async-behavior
Draft

ArgumentNullException when reading empty/null PLP strings with new async behavior#3884
SimonCropp wants to merge 4 commits intodotnet:mainfrom
SimonCropp:ArgumentNullException-when-reading-empty/null-PLP-strings-with-new-async-behavior

Conversation

@SimonCropp
Copy link
Contributor

attempt to replicate #593 (comment)

Copilot AI review requested due to automatic review settings January 12, 2026 23:14
@SimonCropp SimonCropp requested a review from a team as a code owner January 12, 2026 23:14
@github-project-automation github-project-automation bot moved this to To triage in SqlClient Board Jan 12, 2026
@SimonCropp SimonCropp marked this pull request as draft January 12, 2026 23:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a test case to verify that reading empty and null PLP (Partially Length-Prefixed) strings asynchronously does not throw an ArgumentNullException when using the new async behavior. The test is a regression test for issue #593, which originally reported severe performance problems when reading large binary data asynchronously.

Changes:

  • Added a new async test ReadEmptyAndNullPlpStringsAsyncWithNewBehavior that validates reading NULL and empty string values from VARCHAR(MAX), NVARCHAR(MAX), and TEXT columns
  • The test disables compatibility mode to use the new async behavior via the UseCompatibilityAsyncBehaviour switch

@cheenamalhotra cheenamalhotra moved this from To triage to In progress in SqlClient Board Jan 13, 2026
@cheenamalhotra cheenamalhotra added the Area\Tests Issues that are targeted to tests or test projects label Jan 13, 2026
@SimonCropp
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

@SimonCropp
Copy link
Contributor Author

@cheenamalhotra where should i see the PRs i request from copilot?

@ErikEJ
Copy link
Contributor

ErikEJ commented Jan 13, 2026

@SimonCropp I doubt you can control Copilot in this repo - only in your own fork

@SimonCropp
Copy link
Contributor Author

@ErikEJ so isnt that a bug in copilot, that it is offering to submit PRs that it can actually do?

@Wraith2
Copy link
Contributor

Wraith2 commented Jan 13, 2026

If you get a test that works quickly and reliably enough for CI use do you want me to include it in #3872 or do you want to include my change in this PR?, either is fine.

Copilot AI review requested due to automatic review settings March 5, 2026 00:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment on lines +1109 to +1115
cmd.CommandText = $@"
CREATE TABLE {tableName} (
Id INT PRIMARY KEY,
VarcharMaxCol VARCHAR(MAX),
NVarcharMaxCol NVARCHAR(MAX),
TextCol TEXT
)";
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

Table name is injected into CREATE/INSERT/SELECT without quoting (e.g., CREATE TABLE {tableName}), while this file commonly wraps generated object names in brackets (e.g., create table [{tempTableName}]). Please bracket/quote the identifier consistently (and in all three statements) to avoid failures if the generated name contains characters that require quoting or collides with reserved words.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Comment on lines +1106 to +1114
// Create test table with PLP string columns
using (SqlCommand cmd = connection.CreateCommand())
{
cmd.CommandText = $@"
CREATE TABLE {tableName} (
Id INT PRIMARY KEY,
VarcharMaxCol VARCHAR(MAX),
NVarcharMaxCol NVARCHAR(MAX),
TextCol TEXT
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The comment says these are “PLP string columns”, but TEXT is a deprecated LOB type and is not a PLP type like VARCHAR(MAX)/NVARCHAR(MAX). Either update the comment to reflect the actual types being tested, or change/remove the TEXT column to keep the test focused on PLP behavior.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

@paulmedynski
Copy link
Contributor

/azp run

@paulmedynski paulmedynski self-assigned this Mar 5, 2026
@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area\Tests Issues that are targeted to tests or test projects

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

6 participants