You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "thswlsqls (via GitHub) via notifications" <no...@shardingsphere.apache.org> on 2026/10/31 05:22:38 UTC
[PR] Fix getCharacterStream of memory query results reading column index [shardingsphere]
thswlsqls opened a new pull request, #40431:
URL: https://github.com/apache/shardingsphere/pull/40431
Fixes #40429.
Changes proposed in this pull request:
- `AbstractMemoryQueryResult#getCharacterStream` called `getInputStream(columnIndex)`, which resolves to the private `getInputStream(Object)` and serializes the boxed column index instead of reading the row value.
- Read `currentRow.getValue().get(columnIndex - 1)` and set `wasNull`, like the sibling getters; return `null` for SQL NULL, per the JDBC contract and `JDBCStreamQueryResult`.
- Return `Clob#getCharacterStream()` for CLOB, which was the intent of #26094.
- Decode `byte[]` and `Blob` values as bytes, because `toString()` on them would produce `[B@...`; the existing character encoding TODO is kept at that branch.
- Re-add `throws SQLException` on the override (already declared by `QueryResult`), required by `Clob`/`Blob` access.
- Replace the old test, which compared only the first serialized byte, with VARCHAR, CLOB, VARBINARY, BLOB and NULL cases in `JDBCMemoryQueryResultTest`; all five fail without the fix.
AI assistance: Claude Code was used to draft the change and its unit tests in `infra/executor`. I reviewed, verified, and take responsibility for every line submitted.
---
Before committing this PR, I'm sure that I have checked the following options:
- [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
- [x] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the pull request. (Not done: I cannot set labels; a maintainer may add `type: bug`.)
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`. (Full build not run. Ran repository-wide `spotless:check`, `checkstyle:check` and `apache-rat:check` with `-Pcheck`, then `./mvnw install -pl infra/executor -am -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`, all passing.)
- [ ] I have made corresponding changes to the documentation. (Not applicable: no documented behavior changes.)
- [x] I have added corresponding unit tests for my changes.
- [x] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
- [x] I have disclosed the tool and affected files or scope for any material AI assistance, as required by the [AI-assisted contribution policy].
[AI-assisted contribution policy]: https://github.com/apache/shardingsphere/blob/master/AI_POLICY.md
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix getCharacterStream of memory query results reading column index [shardingsphere]
Posted by "thswlsqls (via GitHub) via notifications" <no...@shardingsphere.apache.org>.
thswlsqls commented on PR #40431:
URL: https://github.com/apache/shardingsphere/pull/40431#issuecomment-6646392900
@terrymanu Thanks for the review. `getCharacterStream` now reads `SQLXML` values through `SQLXML#getCharacterStream()`, and `assertGetCharacterStreamWithSQLXML` covers it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix getCharacterStream of memory query results reading column index [shardingsphere]
Posted by "thswlsqls (via GitHub) via notifications" <no...@shardingsphere.apache.org>.
thswlsqls commented on PR #40431:
URL: https://github.com/apache/shardingsphere/pull/40431#issuecomment-6556008727
@terrymanu Thanks for the review. `QueryResult#getCharacterStream` now documents that it returns `null` when the column value is SQL NULL, which also covers `JDBCStreamQueryResult` delegating to `ResultSet#getCharacterStream`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org