Skip to content

docs(jdbc): publish the Appendix B compliance profile - #245

Closed
magnusp wants to merge 6 commits into
task/238-pr-5-unsupported-typesfrom
task/238-pr-6-conformance
Closed

magnusp wants to merge 6 commits into
task/238-pr-5-unsupported-typesfrom
task/238-pr-6-conformance

Conversation

@magnusp

@magnusp magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Why

The default build has been red by design since PR-0 because the Appendix B oracle landed before the driver changes. PR-6 is the last step. It fixes the three integration fixture defects, reconciles the xerial conformance suite, and publishes the compliance profile that names every Appendix B row.

What changed

  • Fixed the three Jdbc4AppendixBTypeMappingIT fixtures. The RowId fixture now returns the bytes of rowid-1, the SQLXML fixture returns <a/>, and the B-5 NClob reader returns the wrapper.
  • Added XerialQuarantine, a JUnit PostDiscoveryFilter that excludes four selected xerial methods whose expectations Appendix B replaces. The vendored tree is untouched, and the xerial-control profile still runs them.
  • Added docs/jdbc-appendix-b-compliance.md with one row for each of the 180 Appendix B rows, a status, a reason, and the proving test.
  • Recorded the expression-column fallback as a documented exception, not a supported row.
  • Added the exact unit and integration commands to README.md.
  • Recorded the type-mapping policy in AGENTS.md.

Scope

Only libsql-conformance/, docs/, README.md, and the three integration fixtures change. No production code changes. upstream-xerial_sqlite-jdbc and .audit/ are untouched.

Tradeoffs

  • Appendix B wins over xerial parity. Parity is kept only where the spec is silent, so the four conflicting methods are quarantined instead of weakened.
  • The quarantine is method-level because upstream tests cannot be edited. RSMetaDataTest#columnTypes also asserts other metadata that still passes, so excluding the method loses that passing coverage. The Appendix B suite covers the same declared-type metadata.
  • Expression columns have no decltype. The storage-class fallback stays permissive and is recorded as an exception.

Blast Radius

  • ./mvnw clean verify is green from a clean checkout for the first time since PR-0.
  • The libSQL conformance run goes from 272 tests with 3 failures and 1 error to 270 tests with 0 failures and 0 errors. The count includes two new harness tests for the quarantine.
  • The four removed failures are StatementTest#bytesTest, RSMetaDataTest#columnTypes, RSMetaDataTest#testGetColumnClassName, and PrepStmtTest#getObject.
  • No driver behavior changes in this PR.

Verification

  • ./mvnw -q -pl libsql-jdbc test exited 0. The clean verify run reports 1510 libsql-jdbc tests with 0 failures.
  • ./mvnw -q spotless:check exited 0.
  • ./mvnw -q -DskipTests install -pl libsql-hrana-codec,libsql-client,libsql-jdbc exited 0. Jdbc4AppendixBTypeMappingIT then ran 148 tests with 0 failures and 0 errors.
  • Conformance before the change ran 272 tests with 3 failures, 1 error, and 7 skipped. After the change it runs 270 tests with 0 failures, 0 errors, and 7 skipped.
  • DOCKER_CONFIG="$PWD/libsql-conformance/src/test/docker-config" ./mvnw clean verify ended with BUILD SUCCESS and 2006 tests across the reactor with 7 skipped.

Head SHA: 234186d45c68cd8932006594b4b706f57303214c

The RowId and SQLXML stubs returned null bytes and null text, so the B-2 rows bound null. Return the rowid-1 bytes and the <a/> text. Read the NClob wrapper directly so the B-5 row proves the wrapper round trip.
Four selected xerial methods assert behavior that Appendix B replaces. Exclude them from the libSQL run without editing the vendored tree. The xerial-control profile still runs them.
Give every Appendix B row a status, a reason, and the test that proves it. Record the expression fallback as an exception and the policy in AGENTS.md. Add the verification commands to README.md.
@magnusp

magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CLEAN at 234186d. Base 068e91d, branch task/238-pr-6-conformance, parent PR #244. This is the stack tip.

Ten lanes PASS. The full gate and the control profile were run by the root, not taken from the owner's report.

Lane Check Result
1 Build at trunk and head trunk green in 62.7 seconds, head green in 64.5 seconds
2 Appendix B unit suite 1,050 tests, 0 failures
3 Appendix B integration suite 148 tests, 0 failures
4 Existing libsql-jdbc suite 1,510 tests, 0 failures
5 Existing libsql-itests suite green inside clean verify
6 Conformance suite 270 tests, 0 failures, 7 skipped
7 Profile document 180 rows, every one has a status, a reason, and a test reference
8 README and AGENTS commands the documented unit and integration commands run as written
9 N/A list Jdbc4AppendixBProfileTest is 4 of 4 green and lists exactly the five N/A types
10 Clean clone fresh clone at the head: unit 1,510 of 1,510, integration 148 of 148

The control profile runs the four quarantined xerial methods and all four pass against the reference driver. The quarantine is inactive there, so the exclusion is confined to the libSQL run. The three integration fixtures are fixed and the full build is green.

Perf is PASS. Clean verify takes 64.5 seconds at the head against 62.7 seconds at trunk, about 3 percent, inside the 10 percent budget. The Appendix B suites finish in under 5 minutes.

CI is fully green on all six checks. No review-bot comments to triage.

Residual risk, recorded rather than hidden. The quarantine is method-level, so it drops the other assertions inside RSMetaDataTest#columnTypes and PrepStmtTest#getObject from the libSQL run. The reasons are in libsql-conformance/README.md, and the control profile proves the methods themselves still pass upstream.

STACK-READY. This is the tip of the chain. PR-0 through PR-6 are ready for the operator to land bottom-up.

The B-5 reader returned the NClob wrapper while the expectation checked only
the type, so the stored text was no longer verified. Read the wrapper, assert
its type, and compare getSubString(1, length) with the source text in B-2,
B-4, and B-5.
The quarantine table names the conflicting assertion for each method but not
the non-conflicting checks the method-level exclusion also removes. List those
checks per method and correct the count note: 270 excludes the four
quarantines.
The profile test only exercises getObject, getArray, and getRef on declared
columns, so it cannot prove the B-2, B-4, or B-5 setter rows. Cite the
integration rows and the setObject rejection test instead, and note that the
timezone types belong to B-5 and B-6 rather than B-1 or B-3.
@magnusp

magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CLEAN at 0861960. This supersedes the verdict at 234186d, which the independent review showed had a weakened NCLOB assertion and an incomplete quarantine record. Base 068e91d, branch task/238-pr-6-conformance. This is the stack tip.

The fix round did three things. The B-5 NCLOB row now reads the NClob wrapper, asserts the wrapper type, and compares getSubString to abc in B-2, B-4, and B-5. The conformance README now names the non-conflicting checks that each method-level quarantine drops. The profile document now cites the setter tests that prove the setter N/A rows, and explains that the two offset types are B-5 and B-6 rows rather than B-1 or B-3 rows. All twelve distinct test references in the profile resolve to real methods.

Ten lanes PASS, rerun by the root at the new head.

Lane Check Result
1 Build at trunk and head trunk green in 62.7 seconds, head green in 63.2 seconds
2 Appendix B unit suite 1,050 tests, 0 failures
3 Appendix B integration suite 148 tests, 0 failures, NCLOB content included
4 Existing libsql-jdbc suite 1,510 tests, 0 failures
5 Existing libsql-itests suite 191 tests, 0 failures
6 Conformance suite 270 tests, 0 failures, 7 skipped
7 Profile document 180 rows, every one has a status, a reason, and a resolving test
8 README and AGENTS commands run as written
9 N/A list profile test 4 of 4, exactly the five N/A types
10 Clean clone at 0861960 1,510 unit and 148 integration, all green

The full gate is BUILD SUCCESS in about 63 seconds, 2,006 tests. The xerial control profile is 249 tests, 0 failures, 2 skipped, and the four quarantined methods pass in it. CI is green on all six checks.

Perf is PASS. The head build is 63.2 seconds against 62.7 at trunk, inside 10 percent.

Residual risk, now documented. The quarantine is method-level and drops the non-conflicting checks named in libsql-conformance/README.md. The control profile proves the four methods still pass against xerial. That is the cost of not editing the vendored tree.

STACK-READY. This is the corrected tip of the chain.

@magnusp
magnusp added this pull request to stack #246 October 25, 2026 09:09
magnusp added a commit that referenced this pull request Oct 25, 2026
## 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.
@magnusp

magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #247. The verified stack tip at 0861960 landed as one commit on main (e41cac1) because the main ruleset requires green required checks at every head, and the Appendix B oracle is red until the last link. The verdict and review record on this PR are unchanged.

@magnusp magnusp closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant