Skip to content

fix(jdbc): route label getters through their int overloads - #254

Merged
magnusp merged 1 commit into
mainfrom
fix/i250-label-getter-checks
Oct 30, 2026
Merged

magnusp merged 1 commit into
mainfrom
fix/i250-label-getter-checks

Conversation

@magnusp

@magnusp magnusp commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Why

getArray(String) and getRef(String) threw SQLFeatureNotSupportedException before any check. Every other label getter delegates through findColumn, so a closed result set, a declared N/A column, and an unknown label all reported the wrong error on these two methods.

What changed

  • LibsqlResultSet#getRef(String) and getArray(String) now call findColumn and delegate to the int overload, matching getBlob, getClob, and getRowId.
  • Added tests for the closed result set, the five N/A declared types, an unknown label, and an ordinary open column on both overloads.

Blast radius

Only error precedence changes on the two label overloads. An unknown label now raises no such column; a closed result set and a declared N/A column now raise the same message as the int overload. No supported read changes. getUnicodeStream and the update* methods are untouched.

Verification

  • ./mvnw -pl libsql-jdbc -Dtest=LibsqlResultSetTest test: 54 tests, 0 failures.
  • ./mvnw clean verify: 1520 JDBC unit tests (1555 unit tests across the reactor), 192 itests, 271 conformance tests with 7 skipped, 0 failures.
  • ./mvnw spotless:check passes.

Fixes #250

@magnusp magnusp changed the title fix(jdbc): route label getters through their int overloads (#250) fix(jdbc): route label getters through their int overloads Oct 30, 2026
@magnusp
magnusp added this pull request to stack #265 October 30, 2026 23:31
@magnusp
magnusp force-pushed the fix/i250-label-getter-checks branch 2 times, most recently from 6d55549 to d6b446c Compare October 30, 2026 23:42
## Why

`getArray(String)` and `getRef(String)` threw
`SQLFeatureNotSupportedException` before any check. Every other label
getter delegates through `findColumn`, so a closed result set, a declared
N/A column, and an unknown label all reported the wrong error on these two
methods.

## What changed

- `LibsqlResultSet#getRef(String)` and `getArray(String)` now call
  `findColumn` and delegate to the int overload, matching `getBlob`,
  `getClob` and `getRowId`.
- Added tests for the closed result set, the five N/A declared types, an
  unknown label, and an ordinary open column on both overloads.

## Blast radius

Only error precedence changes on the two label overloads. An unknown label
now raises `no such column`; a closed result set and a declared N/A column
now raise the same message as the int overload. No supported read changes.

## Verification

- `./mvnw -pl libsql-jdbc -Dtest=LibsqlResultSetTest test`: 54 tests, 0 failures.
- `./mvnw clean verify`: 1555 unit tests, 192 itests, 271 conformance
  tests with 7 skipped, 0 failures.
- `./mvnw spotless:check` passes.

Fixes #250
@magnusp
magnusp force-pushed the fix/i250-label-getter-checks branch from d6b446c to 23e97a6 Compare October 30, 2026 23:48
@magnusp
magnusp merged commit 755f0ce into main Oct 30, 2026
6 checks passed
@magnusp
magnusp deleted the fix/i250-label-getter-checks branch October 30, 2026 23:52
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.

ResultSet label getters bypass the closed and declared-type checks

1 participant