- Notifications
You must be signed in to change notification settings - Fork 614
Fixes and improvements for multiple problems of jdbc_v2 and client_v2 #2302
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.
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
jdbc-v2/src/test/java/com/clickhouse/jdbc/PreparedStatementTest.java Outdated Show resolved Hide resolved
jdbc-v2/src/test/java/com/clickhouse/jdbc/PreparedStatementTest.java Outdated Show resolved Hide resolved
- PreparedStatementImpl: getMetaData returns result set metadata using describe query - StatementImpl: maxRows handling - Driver: unload method fixed (DriverManager search driver for unregister by reference equality) - HttpAPIClientHelper: added sslmode option (presents in v1), support to skip ssl validation fixes: - PreparedStatementImpl: ignores question mark (?) in comments, string literals and quoted identifiers - StatementImpl: multiline block comments trim - HttpAPIClientHelper: null pointer exception with unpooled connection (poolControl is null)
client-v2/src/main/java/com/clickhouse/client/api/ClientConfigProperties.java Outdated Show resolved Hide resolved
client-v2/src/main/java/com/clickhouse/client/api/internal/HttpAPIClientHelper.java Outdated Show resolved Hide resolved
| if (this.currentResultSet != null) { | ||
| return currentResultSet.getMetaData(); | ||
| } else if (statementType != StatementType.SELECT) { | ||
| return null; |
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.
Should it return an empty result set?
I think, null is not expected.
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.
Null is expected according to PreparedStatement javadoc:
* @return the description of a {@code ResultSet} object's columns or * {@code null} if the driver cannot return a * {@code ResultSetMetaData} object
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.
@chernser Removed
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.
Thank you!
I agree that specification allows to return null, but some frameworks doesn't accept it so we need to implement this another way - at least return an empty result set.
jdbc-v2/src/main/java/com/clickhouse/jdbc/PreparedStatementImpl.java Outdated Show resolved Hide resolved
jdbc-v2/src/main/java/com/clickhouse/jdbc/PreparedStatementImpl.java Outdated Show resolved Hide resolved
| @oleg-zinovev thank you for the contribution!
Thanks! |
Done. For example:
sslmode is convenient for DBeaver (and similar programs). It is much easier (in the case of a self-signed certificate) to disable its verification than to explain how to specify the server certificate correctly. So I hope that the ability to disable tls cert validation will be added to client_v2/jdbc_v2 :) |
| @oleg-zinovev thank you for the update! As for SSL strict mode I've created a separate issue #2309
|
Summary
Contains several improvements and fixes for the v2 of the client and driver
Improvements:
Fixes:
Closes #2290
Checklist
Delete items not relevant to your PR: