Repository navigation
Conversation
|
Verdict: CLEAN at 068e91d. Base Ten lanes PASS at the verdict head. Transcripts are under
Units are 1,510 tests, 0 failures, 0 errors. The Appendix B read suite is 1,050 of 1,050 green, the profile test is 4 of 4, and the setObject test is 34 of 34. Spotless is clean. CI now passes the unit jobs and the Xerial control; the only failing job is the integration module. Perf is PASS. The rejection path is 0.99 microseconds at p99 against a 10 microsecond budget. The The integration suite is 148 tests, 3 failures. All three are defects in the test fixtures, not in the driver. A null-returning CI is red only in STACK-READY. PR-6 branches from this head. |
|
Verdict correction, label. |
## 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
SQLite has no interoperable representation for
ARRAY,STRUCT,REF,JAVA_OBJECT, orDISTINCT. Returning a string or an array-shaped value for them hides the gap and disagrees with JDBC 4.3 Appendix B. Under the operator's policy for issue 238, these five types are N/A and must throwSQLFeatureNotSupportedException. Emulation is rejected.The other half of the gap is Table B-6: before this PR the driver returned a value from almost every getter regardless of the declared type. A declared column now rejects a getter that B-6 does not list for it. A column with no
decltypekeeps the permissive storage fallback because Hrana reports no declared type for expressions.What changed
JdbcTypeMappingrecordsARRAY,STRUCT,REF,JAVA_OBJECT, andDISTINCTwithSupport.UNSUPPORTED, and stores the Table B-6 supported set for each getter as a bitmask on every supported declared type.LibsqlResultSetrejects an N/A declared type through every getter, and rejects an unlisted getter/declared-type pair withSQLFeatureNotSupportedException.getObject,getArray, andgetRefthrow for the N/A types.getInton a declaredVARCHARcontainingnot-a-numberthrows instead of returning 0. The expression fallback still returns 0.JdbcValueConverterrejectssetObjectwith an N/A target type. With no target,Array,Struct,Ref, and every other Java class throw because Table B-4 maps them to an N/A type. The existingsetArrayandsetRefrejection is unchanged.SQLFeatureNotSupportedExceptionfor the five N/A types instead of a wrong Java type. The set-object suite keeps the Table B-5 rows and adds an explicit N/A rejection test. The newJdbc4AppendixBProfileTestis the compliance claim: it asserts the exact N/A and supported lists and the N/A behavior.Scope
Changed:
libsql-jdbc/src/main/java/com/github/magnusp/libsql/jdbc/JdbcTypeMapping.javalibsql-jdbc/src/main/java/com/github/magnusp/libsql/jdbc/LibsqlResultSet.javalibsql-jdbc/src/main/java/com/github/magnusp/libsql/jdbc/JdbcValueConverter.javalibsql-jdbc/src/test/java/com/github/magnusp/libsql/jdbc/Jdbc4AppendixBReadTest.javalibsql-jdbc/src/test/java/com/github/magnusp/libsql/jdbc/Jdbc4AppendixBSetObjectTest.javalibsql-jdbc/src/test/java/com/github/magnusp/libsql/jdbc/Jdbc4AppendixBProfileTest.java(new)libsql-itests/src/test/java/com/github/magnusp/libsql/itest/Jdbc4AppendixBTypeMappingIT.javaNot touched:
.audit/, the conformance module, docs, and the offset types from PR-4.N/A list:
ARRAY,STRUCT,REF,JAVA_OBJECT,DISTINCT.Supported list:
TINYINT,SMALLINT,INTEGER,BIGINT,REAL,FLOAT,DOUBLE,NUMERIC,DECIMAL,BIT,BOOLEAN,CHAR,VARCHAR,LONGVARCHAR,NCHAR,NVARCHAR,LONGNVARCHAR,BINARY,VARBINARY,LONGVARBINARY,DATE,TIME,TIMESTAMP,TIME_WITH_TIMEZONE,TIMESTAMP_WITH_TIMEZONE,CLOB,NCLOB,SQLXML,ROWID,BLOB,DATALINK.Tradeoffs
ARRAYhas no fallback. The operator chose that policy for issue 238.BLOBthroughgetIntor aVARCHARthroughgetBytesnow getsSQLFeatureNotSupportedException. That is the Appendix B contract.Blast Radius
ARRAY,STRUCT,REF,JAVA_OBJECT, orDISTINCTcolumn now throwSQLFeatureNotSupportedExceptioninstead of returning text or a wrapper.getIntonINTEGERare unchanged.setObjectwith an N/A target, or with anArray,Struct,Ref, or an unbound Java class and no target, now throws.setNullstill accepts every target type, and the storage fallback for expression columns is unchanged.Verification
Observed on the final head:
./mvnw -q -pl libsql-jdbc -Dtest='Jdbc4AppendixBReadTest' -Dsurefire.failIfNoSpecifiedTests=false test./mvnw -q -pl libsql-jdbc -Dtest='Jdbc4AppendixBProfileTest' test./mvnw -q -pl libsql-jdbc -Dtest='Jdbc4AppendixBSetObjectTest' test./mvnw -q -pl libsql-jdbc test./mvnw -q spotless:check-Dit.test=Jdbc4AppendixBTypeMappingIT verifyThe same integration command at base
3d11c0cfailed 22 tests. All 19 cleared rows are N/A rows. The three that remain are not N/A:B-2: java.sql.RowId -> ROWID(the stub returns no bytes, so the bound value is null)B-2: java.sql.SQLXML -> SQLXML(the stub returns no text, so the bound value is null)B-5: java.sql.NClob -> NCLOB(the test readsgetSubStringas aStringbut expects anNClob)They are pre-existing and outside the PR-5 scope; PR-6 reconciles the remaining integration and conformance failures.