Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2828 +/- ##
============================================
+ Coverage 51.51% 56.28% +4.77%
- Complexity 4081 4520 +439
============================================
Files 149 149
Lines 34268 34378 +110
Branches 5725 5734 +9
============================================
+ Hits 17654 19351 +1697
+ Misses 14125 12397 -1728
- Partials 2489 2630 +141 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@prrvchr , Thank you for contributing to this fix. Your contribution does show up in this PR as above.
We need to follow this process for community PRs (we have done the same for previous set of community contributions) as we are not in position to run a set of internal tests to validate the PR with your contributed PRs. Hence, we create PRs out of your PRs with PR description in our template format, validate the tests and go ahead with the PR merge. Your contribution is valuable and it does show up in the PR above. Thanks |

Problem:
The DatabaseMetaData.supportsIntegrityEnhancementFacility() method incorrectly returns false for SQL Server databases. This method is part of the JDBC specification and indicates whether the database supports integrity enhancement facilities such as primary key and foreign key constraints. SQL Server has comprehensive support for these integrity features, but the driver was not accurately reporting this capability to applications. This could lead to applications incorrectly assuming that SQL Server lacks integrity constraint support, potentially affecting application logic and database schema decisions.
Root Cause:
The supportsIntegrityEnhancementFacility() method in SQLServerDatabaseMetaData.java was hardcoded to return false. This was an incorrect implementation as SQL Server fully supports integrity enhancement facilities including:
Primary key constraints
Foreign key constraints
Check constraints
Unique constraints
NOT NULL constraints
The method implementation did not reflect the actual capabilities of SQL Server, causing a mismatch between the database's features and what the driver reported.
Solution:
Updated the supportsIntegrityEnhancementFacility() method in SQLServerDatabaseMetaData.java to return true instead of false. This change aligns the driver's reported capabilities with SQL Server's actual support for integrity enhancement facilities. The fix ensures that applications using this metadata method will receive accurate information about SQL Server's constraint support capabilities.