Skip to content

fix(rust/core): add InfoCode::Other to handle arbitrary codes - #4510

Merged
lidavidm merged 1 commit into
apache:mainfrom
fornwall:fix/get-info-ignore-unrecognized-codes
Jul 22, 2026
Merged

fix(rust/core): add InfoCode::Other to handle arbitrary codes#4510
lidavidm merged 1 commit into
apache:mainfrom
fornwall:fix/get-info-ignore-unrecognized-codes

Conversation

@fornwall

@fornwall fornwall commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

InfoCode was a closed set of the 11 standard codes, so requests for XDBC-range ([500, 1000)) or vendor-specific (>= 10000) info codes could not be represented: the FFI exporter errored on unknown values before the wrapped Rust driver was called, and the JavaScript client dropped them before the driver manager forwarded the request to the loaded driver.

A driver could still emit such codes when asked for everything (info_codes == None), so a vendor code would appear in "fetch all" results but could not be requested explicitly.

Add an InfoCode::Other(u32) catch-all variant (mirroring the existing Other variants on OptionDatabase/OptionConnection/OptionStatement) so codes survive the u32 round-trip, and pass requested codes through unfiltered in both the FFI exporter and the JavaScript client, leaving "ignore unrecognized codes" to the driver as adbc.h states:

Drivers/vendors will ignore requests for unrecognized codes
(the row will be omitted from the result)

`InfoCode` was a closed set of the 11 standard codes, so requests for
XDBC-range ([500, 1_000)) or vendor-specific (>= 10_000) info codes could
not be represented: the FFI exporter errored on unknown values before the
wrapped Rust driver was called, and the JavaScript client dropped them before
the driver manager forwarded the request to the loaded driver.

A driver could still emit such codes when asked for everything (`info_codes`
== `None`), so a vendor code would appear in "fetch all" results but could not
be requested explicitly.

Add an `InfoCode::Other(u32)` catch-all variant (mirroring the existing
`Other` variants on `OptionDatabase`/`OptionConnection`/`OptionStatement`)
so codes survive the u32 round-trip, and pass requested codes through
unfiltered in both the FFI exporter and the JavaScript client, leaving
"ignore unrecognized codes" to the driver as adbc.h states:

> Drivers/vendors will ignore requests for unrecognized codes
> (the row will be omitted from the result)

Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
@fornwall
fornwall requested a review from wjones127 as a code owner July 13, 2026 22:46

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable enough. CC @eitsupi @felipecrv too.

@eitsupi

eitsupi commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Looks good, thanks.

@lidavidm
lidavidm merged commit 7c4f10a into apache:main Jul 22, 2026
21 checks passed
@lidavidm lidavidm added this to the ADBC Libraries 24 milestone Jul 22, 2026
fornwall added a commit to fornwall/adbc-spanner that referenced this pull request Jul 26, 2026
…0ca4b (UP-9) (#394)

Moves both validation-suite dependency families to their current upstream
`main`, and takes the two behaviour changes that came with them.

**apache/arrow-adbc `198f39a9` -> `3b3f123a`** (all three crates plus the C++
suite's ARROW_ADBC_TAG, previously `65957bba`, in lockstep). The one behaviour
change in range is apache/arrow-adbc#4510, `InfoCode::Other(u32)`: the FFI
exporter used to reject the *whole* `GetInfo` call with "Unknown info code"
before the driver ran, so an XDBC-range ([500, 1000)) or vendor-specific
(>= 10000) code could never be requested even though "fetch all" could return
one. It now forwards them, leaving "ignore unrecognized codes" to the driver as
adbc.h states. No driver change was needed — `info::build` already filters
explicit requests to `REPORTED` and omits the rest — but the contract was
unobservable through the C ABI until now, so pin it from both sides: a unit test
at the trait level and an assertion through the driver manager in
`conformance_via_driver_manager`. Closes UP-9 in REVIEW.md.

apache/arrow-adbc#4534 (the other PR in range worth checking) was already
adopted in #343: SqlPrepareUpdate/Stream are un-excluded and gate-enforced with
RewriteSql entries pinning the new ORDER BY defaults. `c/validation` has had no
commits since, so the tag bump adds no cases, and none of the four survivors in
EXCLUDED are reachable by RewriteSql — three are Arrow type-mapping gaps
(Duration/Interval/UInt64) and one is an arrow-rs FFI stream limitation
(SqlQueryCancel cannot emit ECANCELED).

**adbc-drivers/validation `dbc6857f` -> `1c20ca4b`**, which carries
adbc-drivers/validation#256: `test_query_bind_dictionary` re-binds the
`type/bind/string` and `type/bind/large_string` cases dictionary-encoded — the
layout a pandas categorical produces. Both pass unchanged and are gate-enforced
(not in the skip baseline, which needed no edit): dictionary encoding is an
encoding of the same logical values, not a different logical type, and
`bind::cell_value` already decodes the key at each row back through the same
mapping as the plain column.

Verified: `cargo fmt`/`clippy -D warnings` clean; `with-emulator.sh cargo test`
green (321 unit + 53 integration + 44 mock + 6 resilience + 1 doctest);
`run-adbc-validation.sh` 89 passed / 7 skipped with the gate, expected-failure
and stale guards all OK; `run-foundry-validation.sh` 188 passed / 65 skipped
with FOUNDRY_VALIDATION_REQUIRE_PASSES and the skip-baseline guard on.

Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
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.

3 participants