Repository navigation
fix(jdbc): forward column mapping in table-model PreparedStatement (#18846) #18977
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -233,7 +233,12 @@ private ResultSet processQueryResult(TSExecuteStatementResp resp) throws SQLExce | |
| resp.tracingInfo, | ||
| (long) queryTimeout * 1000, | ||
| resp.isSetMoreData() && resp.isMoreData(), | ||
| zoneId); | ||
| zoneId, | ||
| charset, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forwarding
Please add a mock-based unit test for this (a |
||
| resp.isSetTableModel() && resp.isTableModel(), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two scope notes on this call:
|
||
| resp.getColumnIndex2TsBlockColumnIndexList() == null | ||
| ? null | ||
| : new ArrayList<>(resp.getColumnIndex2TsBlockColumnIndexList())); | ||
| return resultSet; | ||
| } | ||
| 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.
This case and
testPrepareAndExecuteWithRepeatedProjectionbelow do not exercise the code changed by this PR. SQL-levelPREPARE/EXECUTEgoes throughIoTDBStatement.executeQuery()and the fullIoTDBJDBCResultSetconstructor, which already forwardedcolumnIndex2TsBlockColumnIndexListbefore this PR. The client-sideIoTDBTablePreparedStatement(the?-parameter path throughexecutePreparedStatementandprocessQueryResult) is never involved.Verified with the master client on a live 1C1D server, using the same two projections on an equivalent table (filtering on an INT32 column instead of
id):PREPARE ... FROM SELECT value, name ...followed byEXECUTE ... USINGalready returns200.3, Bob, and thename AS x, name AS yvariant already returnsBob, Bob. So both new cases pass with and without this fix.They are still useful as coverage for the server-side prepared-statement path, but please do not count them as regression tests for this fix in the PR description. The regression coverage for the changed code is the new unit tests plus
IoTDBTablePreparedStatementJDBCIT, whose reordered / repeated / TIMESTAMP queries I confirmed fail against the master client.