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 7 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 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 51.26%. Comparing base (ae462f9) to head (18c96b5).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...m/microsoft/sqlserver/jdbc/SQLServerStatement.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2554      +/-   ##
============================================
+ Coverage     50.99%   51.26%   +0.27%     
- Complexity     3911     3971      +60     
============================================
  Files           147      147              
  Lines         33456    33458       +2     
  Branches       5604     5605       +1     
============================================
+ Hits          17060    17153      +93     
+ Misses        13992    13925      -67     
+ Partials       2404     2380      -24     

☔ 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
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
4 participants