-
Notifications
You must be signed in to change notification settings - Fork 614
[JDBC-V2] Fix DatabaseMetadata to return empty ResultSet where expected #2534
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes DatabaseMetadata methods to return empty ResultSets instead of single rows with default values, which improves compatibility with UI tools. The fix addresses an issue where UI tools were breaking due to unexpected data in metadata methods that should return empty datasets.
- Adds
LIMIT 0clause to metadata queries to ensure they return empty ResultSets - Updates corresponding tests to verify empty ResultSets are returned
- Improves comments to clarify why these methods should return empty datasets
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| DatabaseMetaDataImpl.java | Adds LIMIT 0 to metadata queries and improves comments about ClickHouse not supporting foreign keys |
| DatabaseMetaDataTest.java | Adds assertions to verify empty ResultSets and minor import reordering |
jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java
Outdated
Show resolved
Hide resolved
jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java
Outdated
Show resolved
Hide resolved
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|



Summary
There are some method in metadata that should return empty dataset with specific structure. Previously a single row with default values was returned. This breaks UI tools because they use this data for further work.
Closes #2517
Checklist
Delete items not relevant to your PR: