-
Notifications
You must be signed in to change notification settings - Fork 443
Fixed issue for PreparedStatement INSERT multiple values update count issue with triggers #2817
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2817 +/- ##
============================================
+ Coverage 52.25% 52.52% +0.27%
- Complexity 4155 4201 +46
============================================
Files 149 149
Lines 34366 34500 +134
Branches 5733 5778 +45
============================================
+ Hits 17958 18122 +164
+ Misses 13914 13912 -2
+ Partials 2494 2466 -28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
divang
approved these changes
Nov 4, 2025
muskan124947
approved these changes
Nov 4, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed issue for PreparedStatement INSERT multiple values update count issue with triggers
This pull request refactors how update counts are determined for INSERT statements in the JDBC driver, ensuring more accurate update counts, especially for
PreparedStatementexecutions involving triggers and multiple value inserts. It removes the subclass override mechanism for TDS token processing and centralizes the logic. Additionally, a new unit test is added to validate correct behavior with triggers and multiple inserts.Refactoring and logic simplification:
hasUpdateCountTDSTokenForInsertCmd()method and its overrides from bothSQLServerStatementandSQLServerPreparedStatement, consolidating the logic for handling update counts for INSERT commands. [1] [2]Testing improvements:
testPreparedStatementInsertMultipleValuesWithTrigger, to ensure thatPreparedStatementcorrectly returns the number of inserted rows when using multiple values and triggers, addressing a prior bug where the update count could be incorrect.