Skip to content

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

Open
fornwall wants to merge 1 commit into
apache:mainfrom
fornwall:fix/get-info-ignore-unrecognized-codes
Open

fix(rust/core): add InfoCode::Other to handle arbitrary codes#4510
fornwall wants to merge 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
Contributor

Looks good, thanks.

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