Skip to content
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

Issue#2550 - Fixed getGeneratedKeys functionality for execute API #2554

Merged
merged 12 commits into from
Jan 30, 2025

Conversation

machavan
Copy link
Contributor

@machavan machavan commented Dec 4, 2024

Description:

The execute API for INSERT was not reading off the explicit TDS_DONE token that actually contains the update count returned by the server. As a result, it was not able to correctly report back the update count for getUpdateCount and also the subsequent resultsets on getMoreResults.

Note that this works correctly for excecuteUpdate API.

Testing:

  • All existing tests pass
  • Introduced a number of tests testing various combinations of execute/executeUpdate API, INSERT/UPDATE/DELETE/MERGE DML operations, followed by explicit SELECT statement or getGeneratedKeys call.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 8 lines in your changes missing coverage. Please review.

Project coverage is 51.37%. Comparing base (08cd6fd) to head (4b5b941).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 50.00% 4 Missing and 3 partials ⚠️
...oft/sqlserver/jdbc/SQLServerPreparedStatement.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2554      +/-   ##
============================================
+ Coverage     51.22%   51.37%   +0.14%     
- Complexity     3953     3976      +23     
============================================
  Files           147      147              
  Lines         33657    33664       +7     
  Branches       5624     5626       +2     
============================================
+ Hits          17241    17295      +54     
+ Misses        13999    13936      -63     
- Partials       2417     2433      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jeffery-Wasty Jeffery-Wasty linked an issue Dec 9, 2024 that may be closed by this pull request
@tkyc
Copy link
Member

tkyc commented Dec 10, 2024

Internal tests pass

@lilgreenbird lilgreenbird added this to the 12.10.0 milestone Dec 11, 2024
@martinoconnor
Copy link

Suggestion: may also wish to verify that the execute API works with SET NOCOUNT ON;

@machavan
Copy link
Contributor Author

Suggestion: may also wish to verify that the execute API works with SET NOCOUNT ON;

Yes, verified with execute API and added a new test case

@machavan
Copy link
Contributor Author

ADO pipeline tests passed with the PR.

@machavan machavan merged commit 25ea8da into main Jan 30, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

Error getting generated keys after insert
7 participants