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

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

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.23%. Comparing base (2a3d372) to head (596aafc).

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.11%   51.23%   +0.12%     
- Complexity     3924     3941      +17     
============================================
  Files           147      147              
  Lines         33505    33512       +7     
  Branches       5614     5616       +2     
============================================
+ Hits          17126    17170      +44     
+ Misses        13961    13903      -58     
- Partials       2418     2439      +21     

☔ 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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Under Peer Review
Development

Successfully merging this pull request may close these issues.

Error getting generated keys after insert
5 participants