Repository navigation
Conversation
Each wrapper holds the materialized value of one result column and rejects every read once freed. NClob reuses the Clob text holder because SQLite stores national and regular text identically; SQLXML and RowId are read-only views over the same text and bytes.
getURL parses DATALINK text and throws on text that is not a URL. getNClob, getSQLXML, and getRowId wrap the stored text or bytes, and getObject routes NCLOB, SQLXML, ROWID, and DATALINK to the same wrappers. getAsciiStream reads text as US-ASCII and getNCharacterStream delegates to getNString. SQLXML and ROWID join the declared-type registry so the metadata and getObject agree on their object type.
setSQLXML binds the SQLXML content as text. setRowId binds the bytes as a BLOB, which is the only representation getRowId reads back unchanged. setArray and setRef still throw.
B-1 and B-3 now check the URL, NClob, SQLXML, RowId, ASCII, and NCHAR getters end to end. A freed wrapper must reject every further read.
|
Verdict: CLEAN at 4067d42. Base Ten lanes PASS at the verdict head. Transcripts are under
Units are 1,503 tests, 634 failures, 0 errors. B-1 is down from 7 to 3 and B-3 from 7 to 3, both leaving only the PR-5 types. The B-6 listed-cell failures are down from 27 to 2. The B-6 total rose to 627 because the new getters now answer unlisted cells that PR-5's supported-set gate must reject, which is the plan's sequence. Spotless is clean. The integration suite at this head is 146 tests, 26 failures, down from 45 at PR-2 and 63 at the baseline. The remaining rows are the ARRAY, STRUCT, and REF types owned by PR-5. Perf is PASS. Over 100,000 calls, CI is red only where Appendix B is red, by design. No review-bot comments to triage. STACK-READY. PR-4 branches from this head. |
|
Verdict correction, evidence. The stale-jar run's output was not preserved. The corrected run is the worktree failsafe report at |
## Why The driver mapped result values by storage class, so the declared type did not control metadata or `getObject`, and `setObject` ignored the target type. JDBC 4.3 Appendix B is the oracle. Seven stacked pull requests implement it. The stack cannot land link by link because the `main` ruleset requires the full build green at every head, and the Appendix B oracle is red until the last link. This PR lands the verified tip as one commit. ## What changed - Add the Appendix B oracle suite and the vendor table, then resolve one JDBC type per declared column for metadata and `getObject`. - Honor the `setObject` target type, add the missing getters and LOB wrappers, and support the offset temporal types. - Mark `ARRAY`, `STRUCT`, `REF`, `JAVA_OBJECT`, and `DISTINCT` N/A and reject unlisted Table B-6 conversions. - Publish the compliance profile, quarantine the four xerial tests that conflict with the spec, and record the policy. ## Scope The seven stacked PRs are #239, #240, #241, #242, #243, #244, and #245. No unrelated changes. `vendor/JDBC4-TYPE-MAPPING.md` is the oracle. ## Tradeoffs - The five unrepresentable types throw instead of emulating them. - The conformance quarantine is method-level. The lost checks are named in `libsql-conformance/README.md`. - An expression column with no `decltype` keeps the storage fallback, documented as a profile exception. ## Blast Radius Metadata and `getObject` now follow the declared type, so a `BIGINT` holding 42 returns `Long`, and an unlisted getter conversion throws. The default build was red from #239 through #245 by design and is green at this tip. ## Verification - `clean verify` at `0861960`: 2,006 tests, 0 failures, 7 skipped, about 63 seconds. - Appendix B unit 1,050 of 1,050, integration 148 of 148, conformance 270 of 270 with 7 skipped. - Clean clone at the same SHA: unit 1,510 of 1,510, integration 148 of 148. - Each link has a verdict and ten live lanes. The verdict comments are on #239 through #245.
Why
JDBC 4.3 Appendix B lists native getters for
DATALINK,NCLOB,SQLXML,and
ROWID, plus the ASCII and national character streams, and this driverthrew
SQLFeatureNotSupportedExceptionfor all of them. PR-3 adds thoseread paths and the two missing parameter setters so the oracle's B-1, B-3,
and the listed cells of B-6 can go green.
What changed
LibsqlNClob,LibsqlSQLXML, andLibsqlRowIdwrappers in thedriver package. Each holds the materialized value of one column and every
read after
free()throwsSQLException.getURLparsesDATALINKtext throughURI.toURL()and throwsSQLException(withMalformedURLExceptionas the cause) when the text isnot an absolute URL.
getNClob,getSQLXML, andgetRowIdbuild the new wrappers over thestored text or bytes.
getObjectroutesNCLOB,SQLXML,ROWID, andDATALINKto the same wrappers, so the object type and the typed getteragree.
getAsciiStreamreads the text as US-ASCII bytes andgetNCharacterStreamdelegates togetNString.setSQLXMLbinds the SQLXML content as text.setRowIdbinds the bytes asa BLOB, the one representation
getRowIdreads back unchanged.SQLXMLandROWIDjoin the declared-type registry soResultSetMetaData.getColumnType,getColumnClassName, andgetObjectresolve them instead of falling back to the storage class.
LibsqlClobis no longerfinal, soLibsqlNClobreuses it: SQLitestores national and regular text identically.
setArrayandsetRefstill throw; PR-5 decides their status. No Appendix Bassertion was relaxed.
Scope
Read and bind only. No change to the declared-type model beyond the two new
registry rows, no change to
JdbcValueConverter, no wiring change, no newdependency, no interaction change.
Tradeoffs
SQLXML.getSourceandsetResultthrowSQLFeatureNotSupportedException.The wrapper is a read-only view over stored text; callers read it through
getStringorgetCharacterStream. Parsing XML is left to the caller.setRowIdbinds a BLOB rather than text because text would lossily decodebytes that are not valid UTF-8, and the round trip is the contract.
The six new getters now succeed on columns whose Table B-6 row lists no
conversion, and PR-6 adds the per-getter supported set that rejects them.
Blast Radius
getObjectreturn type changes for four declared types:DATALINKnowreturns
URL,NCLOBNClob,SQLXMLSQLXML,ROWIDRowId. All fourpreviously returned the storage-class value (
String/Integer/byte[]).ResultSetMetaDatanow reportsTypes.SQLXML/Types.ROWIDand the matchingclass names for
SQLXML- andROWID-declared columns instead of thestorage fallback.
LibsqlResultSetTestno longer lists them as unsupported.getAsciiStreamreplaces non-ASCII characters with?, which is theUS-ASCII encoder's contract; it is not a UTF-8 alias.
LibsqlCloblosesfinal; no public API change (package-private class).Verification
Unit, at head
4067d42:./mvnw -q -pl libsql-jdbc -Dtest='Jdbc4AppendixBReadTest#b1NaturalGetterReturnsDeclaredJavaType' -Dsurefire.failIfNoSpecifiedTests=false test->
Tests run: 34, Failures: 3. Down from 7; the three left(
ARRAY,STRUCT,REF) belong to PR-5../mvnw -q -pl libsql-jdbc -Dtest='Jdbc4AppendixBReadTest#b6GetterHonoursSupportedJdbcTypes' -Dsurefire.failIfNoSpecifiedTests=false test->
Tests run: 972, Failures: 627. Listed-cell ("must support") failuresare 2, down from 27:
getArrayonARRAYandgetRefonREF, bothPR-5. The rest are the "must reject" cells PR-6 owns.
./mvnw -q -pl libsql-jdbc test->
Tests run: 1503, Failures: 634, Errors: 0. Every failure is inJdbc4AppendixBReadTest; all 17 other test classes pass, includingJdbc4AppendixBSetObjectTest(B-5) at33/0. B-3 fell from 7 to 3(
ARRAY,STRUCT,REF)../mvnw -q spotless:check-> exit 0.New tests in
Jdbc4AppendixBReadTest:b1UrlGetterParsesAbsoluteTextAndRejectsTheRest,b3NewWrappersReadBackTheirContent(length, substring, both streams),b3FreedWrappersRejectFurtherReads(NClob, SQLXML, Clob, Blob), andb3RowIdComparesAndCopiesItsBytes.LibsqlPreparedStatementTestaddsrowIdAndSqlXmlParametersBindTheirContentandrowIdBoundAsBlobReadsBackTheSameBytes.Live lanes and the perf probe are not run here; this PR stops at STACK-READY
for the root's swarm.