Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request enables the execution of Select and Read command types via ExecuteNonQuery and ExecuteNonQueryAsync by introducing a new ExecuteQueryNonQueryAsync method that executes the query and returns -1. It also updates the corresponding exception message and adds unit tests to verify this behavior. There are no review comments, and I have no feedback to provide.
a3c09ea to
0bd5ebb
Compare
Summary
Allow
ExecuteNonQueryandExecuteNonQueryAsyncto run SELECT and read commands, discard the result reader, and return -1. Add sync and async regression tests.Resolves #16049.
Microsoft contract
Microsoft documents
IDbCommand.ExecuteNonQueryas executing SQL and returning -1 for statement types other than UPDATE, INSERT, and DELETE; its documentation includes a SELECT example: https://learn.microsoft.com/dotnet/api/system.data.idbcommand.executenonqueryCompatibility
SELECT/read commands that currently throw will execute, discard results, and return -1. DML and DDL behavior is unchanged. Callers using the exception to reject queries through this API may observe this change.
Validation
Focused provider tests:
dotnet test apis/Google.Cloud.Spanner.Data/Google.Cloud.Spanner.Data.Tests/Google.Cloud.Spanner.Data.Tests.csproj --no-restore -f net8.0 -p:NoWarn=CS8981%3BxUnit2004%3BxUnit2013 --filter FullyQualifiedName~ExecuteNonQuery— 2 passed, 0 failed.Discovery
Found using pengdows.AdoNetApiTest.conformance.