Repository navigation
fix(jdbc): read declared columns through implemented getters - #251
Merged
Merged
Conversation
Table B-6 was enforced as a rejection list, so getBytes on a declared BLOB threw SQLFeatureNotSupportedException. Treat the table as the required support matrix and let the stored value decide the conversion, matching sqlite-jdbc. Only the five N/A declared types remain rejected. The getter mask, Getter enum, and getterMask field were used only by the rejection, so remove them.
Owner
Author
|
PASS+NOTES Independent shipping verification of PR #251, parent vs head, using a fresh JUnit IT written as a JDBC user would use the driver. Revisions
Repro testTemporary untracked test statement.execute("CREATE TABLE blob_read_repro (v BLOB)");
// INSERT ... VALUES (?) with setBytes(1, "abc".getBytes(UTF_8))
assertThat(resultSet.next()).isTrue();
assertThat(resultSet.getBytes(1)).isEqualTo(BYTES_ABC);
assertThat(resultSet.getString(1)).isEqualTo("abc");Not committed. It remained untracked across both checkouts. Parent (main @ 8e5cd4e): fails as expected
Fails on Head (@ 4a359b0): passesSame repro test, same command: Unit suite built by PR's own targeted regression test: That test asserts Commands runNotes (non-blocking)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A declared
BLOBcolumn rejectedgetBytes. The driver treated JDBC 4.3 Appendix B Table B-6 as a rejection list instead of the set of conversions a driver must support, so a getter that was not listed for the declared type threwSQLFeatureNotSupportedException. xerial reads these columns, and users reported the error.What changed
LibsqlResultSetnow rejects only the five N/A declared types. A representable column reads through every implemented getter, and the stored value decides the conversion.Getterenum, andgetterMaskfield that only served the rejection.StatementTest#bytesTestand added a real-DDL regression for a declaredBLOB.Scope
Leaves
setObjectTable B-5 strictness unchanged. Opens follow-up issues for the label overloads ofgetArrayandgetRef(#250) and the unusedJdbcType.storagecomponent (#249).Blast Radius
Read behavior changes for declared columns that were previously rejected. Rejection now comes only from the stored value, so a bad conversion still throws
SQLException. The five N/A types behave as before.Verification
./mvnw testruns 1511 JDBC tests with no failures../mvnw -pl libsql-conformance -am verifyruns 271 tests with 7 skipped and no failures.Jdbc4AppendixBTypeMappingIT#b6DeclaredBlobReadsThroughByteAndTextGetterspasses against the pinnedsqldimage.