Skip to content

test(jdbc): add the JDBC 4.3 Appendix B oracle suite - #239

Closed
magnusp wants to merge 3 commits into
mainfrom
task/238-pr-0-oracle-suite
Closed

magnusp wants to merge 3 commits into
mainfrom
task/238-pr-0-oracle-suite

Conversation

@magnusp

@magnusp magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Why

The driver claims JDBC 4.3 support, but nothing executes the Appendix B type tables against it. This PR adds that oracle and lands it before any production change, so every later PR can show which rows it turns green.

What changed

  • Add Jdbc4AppendixBReadTest, covering Tables B-1, B-3, and B-6 on the read path.
  • Add Jdbc4AppendixBSetObjectTest, covering Table B-5 on the write path.
  • Add Jdbc4AppendixBTypeMappingIT, which drives the same tables against the pinned sqld container.
  • Carry vendor/JDBC4-TYPE-MAPPING.md, the specification extract the tests encode.

Scope

Test sources and the vendor document only. No driver behavior changes. The suite is expected to fail on arrival.

Tradeoffs

Folding the suite into PR-1 would keep main green until the model lands. A separate PR-0 was chosen so the oracle is reviewed and landed on its own, and so PR-1 does not hide two thousand lines of tests inside a behavior change.

Blast Radius

main turns red when this lands, by design, and stays red until PR-6. The suite adds about ten seconds to the unit build and runs only under the Jdbc4AppendixB* filter in CI until PR-6 wires it in.

Verification

  • Unit suite at 6a9e74a: 1,077 tests, 518 failures, 0 errors. The failures name Appendix B rows.
  • Integration suite at 6a9e74a against the pinned sqld image: 146 tests, 63 failures, 0 errors.
  • spotless:check passes.

The suite encodes Tables B-1 through B-6 from the JDBC 4.3 specification. It fails on the current driver by design and becomes the evidence for the compliance stack.
@magnusp

magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Verdict: CLEAN at 6a9e74a. PR-0 is the stack root and targets main. Base c4357d2.

Lane results, all PASS. Transcripts live under /tmp/swarm-pr-0/.

Lane Check Expected Actual
1 Trunk versus head unit suite trunk runs none, head 1,077/518 no tests at c4357d2, head 1,077 tests, 518 failures
2 B-1 unit 7 7
3 B-3 unit 18 18
4 B-5 unit 31 31
5 B-6 unit 462 462
6 B-1 integration 7 7 testcases
7 B-2 integration 8 8
8 B-3 integration 18 18 testcases
9 B-4 integration 14 14
10 B-5 and B-6 integration 26 and 8 26 and 8 rows

Perf is PASS. The unit suite takes 2.6 seconds at the head, and the integration suite takes 4.5 seconds with the container cache warm. Both are far inside the 60 second and 5 minute budgets.

CI is red by design. Build & Test (Java 25) and (Java 26) fail only inside Jdbc4AppendixBReadTest, Jdbc4AppendixBSetObjectTest, and the integration suite, which is what this PR lands. CodeQL and dependency submission pass. The plan keeps the default build red until PR-6.

STACK-READY for the operator to land. PR-1 branches from this head.

@magnusp

magnusp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Verdict correction, evidence only. The perf comparison in the original verdict was not like-for-like. The head run omitted -am and the trunk run included it. Rerun with the same command at both heads, three pairs: trunk 4.61, 4.54, 4.47 seconds; head 5.75, 5.69, 5.87 seconds. Both are under the 60 second budget. The suite adds about 1.2 seconds, not under one second. The rule is absolute, so the verdict stands and the wording is corrected.

The issue's decision line also said PR-0 would carry one live lane. Execution used ten per-table baseline lanes and a wall-time budget. Your decision was to land the suite as PR-0; the lane definition was the root's call within that grant. Issue 238 now records that.

@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