-
Notifications
You must be signed in to change notification settings - Fork 597
[JDBC] ResultImpl fixed #2530
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
[JDBC] ResultImpl fixed #2530
Conversation
…ed methods in result setimpl
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
|
||
@Test(groups = {"integration"}) | ||
public void testGetMetadata() throws SQLException { | ||
try (Connection conn = getJdbcConnection(); Statement stmt = conn.createStatement()) { |
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 expand this to all types
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.
This test verifies that metadata returns expected types.
We have another issue for Parameter and ResultSetMetadata - so will cover their.
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 refactors the JDBC ResultSet implementation to properly handle unsupported operations through a new FeatureManager class and improves test coverage.
- Introduces a FeatureManager to centralize handling of unsupported JDBC operations based on configuration
- Implements proper cursor position tracking and fetch size handling in ResultSetImpl
- Adds comprehensive test coverage for unsupported operations, cursor positioning, and fetch functionality
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
FeatureManager.java | New utility class to handle unsupported feature exceptions based on configuration |
ResultSetImpl.java | Major refactoring to use FeatureManager, implement cursor tracking, and proper fetch size handling |
StatementImpl.java | Fixes fetch size implementation and adds statement reopening logic |
StatementTest.java | Updates test assertion to reflect corrected fetch size behavior |
ResultSetImplTest.java | Extensive new test coverage for unsupported operations, cursor positioning, and metadata |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
} | ||
|
||
return false; | ||
return !reader.hasNext() && rowPos != AFTER_LAST; |
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 isLast() method implementation may be incorrect. It returns true when there are no more rows AND the cursor is not after the last row, but this doesn't properly handle the case where the cursor is on the actual last row. Consider tracking whether the current row is the last row more explicitly.
return !reader.hasNext() && rowPos != AFTER_LAST; | |
return rowPos == LAST_ROW; |
Copilot uses AI. Check for mistakes.
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.
Fixed. Added a test.
|
Summary
Closes #2415
Closes #2300
Checklist
Delete items not relevant to your PR: