-
Notifications
You must be signed in to change notification settings - Fork 614
[jdbc-v2] Fix statement impl #2471
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
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
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 statement implementation in the JDBC v2 driver by improving state management, result set handling, and SQL processing. It addresses missing implementations and consolidates SQL utilities to ensure proper JDBC compliance.
Key Changes
- Comprehensive statement state management with proper result set lifecycle handling
- Moved SQL utilities from
SqlParserto centralizedSQLUtilsclass for better maintainability - Enhanced JDBC specification compliance with missing method implementations
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| StatementImpl.java | Major refactoring with proper state management, result set tracking, and complete JDBC method implementations |
| PreparedStatementImpl.java | Updated to use ensureOpen() and SQLUtils for consistent state validation |
| WriterStatementImpl.java | Updated to use ensureOpen() for state validation consistency |
| SQLUtils.java | New centralized utility class for SQL string processing and identifier handling |
| SqlParser.java | Removed duplicate utility methods now centralized in SQLUtils |
| DatabaseMetaDataImpl.java | Updated to use SQLUtils for SQL literal escaping |
| ParsedStatement.java | Updated to use SQLUtils for identifier processing |
| ParsedPreparedStatement.java | Updated to use SQLUtils for identifier processing |
| Various test files | Added comprehensive test coverage for new functionality |
| BETA_ROW_BINARY_WRITER("beta.row_binary_for_simple_insert", "false"), | ||
|
|
||
| /** | ||
| * Enables closing result set before |
Copilot
AI
Jul 21, 2025
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.
The comment is incomplete. It should describe what happens "before" - likely "before executing new statements" or similar.
| * Enables closing result set before | |
| * Enables closing the result set before executing new statements or when the statement is closed. | |
| * This helps to free up resources automatically without requiring explicit result set closure. |
| * @return true if the identifier needs to be quoted, false otherwise | ||
| */ | ||
| private static boolean needsQuoting(String identifier) { | ||
| if (identifier.isEmpty()) { |
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 we check here if the identifier is 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.
Yes, I've added IllegalArgumentException
|
We get this 56.4% Coverage on New Code (required ≥ 80%) |
|
|
@mzitnik I've fixed the coverage report |


Summary
Closes #2414
Checklist
Delete items not relevant to your PR: