Skip to content

Fixed getSchemas catalog filtering logic and added test case to validate built-in schema handling (#2639)#2643

Merged
Ananya2 merged 6 commits intomainfrom
users/anagarg/issue#2639
Apr 23, 2025
Merged

Fixed getSchemas catalog filtering logic and added test case to validate built-in schema handling (#2639)#2643
Ananya2 merged 6 commits intomainfrom
users/anagarg/issue#2639

Conversation

@Ananya2
Copy link
Copy Markdown
Contributor

@Ananya2 Ananya2 commented Apr 8, 2025

Github Issue: #2639
Fixed incorrect filtering behavior in DatabaseMetaData.getSchemas when a specific catalog name is provided. Previously, the driver returned system/predefined schemas with a null catalog even when a catalog was specified, violating the JDBC specification. This update ensures that only schemas belonging to the specified catalog are returned, and system schemas without a catalog are properly excluded from the result set.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 51.63%. Comparing base (3e8672a) to head (5bae521).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...soft/sqlserver/jdbc/SQLServerDatabaseMetaData.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2643   +/-   ##
=========================================
  Coverage     51.63%   51.63%           
- Complexity     4003     4012    +9     
=========================================
  Files           147      147           
  Lines         33757    33759    +2     
  Branches       5639     5640    +1     
=========================================
+ Hits          17429    17432    +3     
- Misses        13871    13888   +17     
+ Partials       2457     2439   -18     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@David-Engel David-Engel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look fine. Just some adjustments needed to the new test.

Also, please include a description on all PRs. Descriptions should include references to source issues and enough details for a reviewer to understand the purpose and goal of the PR before looking at the code changes.

@Ananya2 Ananya2 requested a review from David-Engel April 21, 2025 13:20
Copy link
Copy Markdown
Collaborator

@David-Engel David-Engel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't forget to update the description, too! Thanks!

@Ananya2 Ananya2 force-pushed the users/anagarg/issue#2639 branch from 9ee0d34 to 5bae521 Compare April 22, 2025 03:15
@Ananya2
Copy link
Copy Markdown
Contributor Author

Ananya2 commented Apr 23, 2025

ADO pipeline:

@Ananya2 Ananya2 merged commit 351c2be into main Apr 23, 2025
19 checks passed
@David-Engel David-Engel added this to the 12.11.0 milestone May 9, 2025
@Ananya2 Ananya2 deleted the users/anagarg/issue#2639 branch June 16, 2025 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DatabaseMetaData's getSchemas does not filter out database-level roles, INFORMATION_SCHEMA, sys schema, etc.

4 participants