test(c/validation): assert GetInfo all-codes result covers explicitly requested codes - #23
Open
fornwall wants to merge 1 commit into
Open
test(c/validation): assert GetInfo all-codes result covers explicitly requested codes#23fornwall wants to merge 1 commit into
fornwall wants to merge 1 commit into
Conversation
… requested codes AdbcConnectionGetInfo with NULL info_codes fetches all metadata the driver recognizes (adbc.h). A driver that returns a row for an explicitly requested info code therefore recognizes that code, so the same code must also appear in the all-codes result; otherwise the two forms disagree about what the driver supports. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGf8PVEe2tYkw8Q6Pd95tq
This was referenced Jul 13, 2026
Closed
fornwall
added a commit
to fornwall/adbc-spanner
that referenced
this pull request
Jul 13, 2026
get_info was asymmetric: the all-codes result reported a curated 7-code
subset, while an explicit request for the omitted codes (VendorVersion,
VendorArrowVersion, the Substrait version bounds) still yielded a
null-valued row. Per adbc.h, omission is reserved for *unrecognized*
codes ("Drivers/vendors will ignore requests for unrecognized codes
(the row will be omitted from the result)"), so a code answered
explicitly must also appear in the NULL/fetch-all result — the
invariant fornwall/arrow-adbc#23 adds to the C++ validation suite as
ConnectionTest.MetadataGetInfoAllCodes.
Keep the null rows (adbc.h defines null as the *value* of the Substrait
bounds when Substrait is unsupported, and the driver's VendorVersion
null is deliberate — Spanner exposes no server version) and instead:
- REPORTED now lists all 11 recognised codes in code order, so
get_info(None) includes the null-valued rows.
- Explicit requests filter to REPORTED, omitting unrecognized codes per
spec, so explicit ⊆ all holds structurally even if the
#[non_exhaustive] InfoCode enum grows a variant this driver doesn't
enumerate.
Verified end-to-end through the driver manager against the emulator:
all-codes = {0,1,2,3,4,5,6,100,101,102,103}, every explicit request
answered with the expected value and covered by the all-codes result
(the exact check of the validation test in fornwall/arrow-adbc#23,
which fails on the previous behaviour).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NQDZMXWrvKfvbj4V32f89e
fornwall
added a commit
to fornwall/adbc-spanner
that referenced
this pull request
Jul 15, 2026
…274) get_info was asymmetric: the all-codes result reported a curated 7-code subset, while an explicit request for the omitted codes (VendorVersion, VendorArrowVersion, the Substrait version bounds) still yielded a null-valued row. Per adbc.h, omission is reserved for *unrecognized* codes ("Drivers/vendors will ignore requests for unrecognized codes (the row will be omitted from the result)"), so a code answered explicitly must also appear in the NULL/fetch-all result — the invariant fornwall/arrow-adbc#23 adds to the C++ validation suite as ConnectionTest.MetadataGetInfoAllCodes. Keep the null rows (adbc.h defines null as the *value* of the Substrait bounds when Substrait is unsupported, and the driver's VendorVersion null is deliberate — Spanner exposes no server version) and instead: - REPORTED now lists all 11 recognised codes in code order, so get_info(None) includes the null-valued rows. - Explicit requests filter to REPORTED, omitting unrecognized codes per spec, so explicit ⊆ all holds structurally even if the #[non_exhaustive] InfoCode enum grows a variant this driver doesn't enumerate. Verified end-to-end through the driver manager against the emulator: all-codes = {0,1,2,3,4,5,6,100,101,102,103}, every explicit request answered with the expected value and covered by the all-codes result (the exact check of the validation test in fornwall/arrow-adbc#23, which fails on the previous behaviour). Claude-Session: https://claude.ai/code/session_01NQDZMXWrvKfvbj4V32f89e Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out from #21 (2/5).
Adds
ConnectionTest.MetadataGetInfoAllCodesto the generic C++ validation suite: any info code a driver answers when explicitly requested must also appear in theGetInfo(NULL)(all-codes) result.get_info(None)returns a curated subset while explicit requests answer more codes)adbc.hdoc forAdbcConnectionGetInfo(adbc.h:1550-1552): "info_codes A list of metadata codes to fetch, or NULL to fetch all"; and adbc.h:1539-1541: unrecognized requested codes are omitted from the result. A code returned for an explicit request is therefore recognized by the driver, so it must also appear in the NULL/all-codes result.VENDOR_VERSION) and 2 (VENDOR_ARROW_VERSION) return rows, but the all-codes result is{0, 3, 4, 100, 101, 102, 103}(verified by actual run on the Spanner emulator).supports_get_sql_info()so drivers without GetInfo skip.The test is written against the generic
DriverQuirksfixtures, so it auto-enrolls for every driver usingADBCV_TEST_CONNECTION; candidate for later upstream submission to apache/arrow-adbc.🤖 Generated with Claude Code
https://claude.ai/code/session_01EGHTnNywAfCfbe4DoNcfuz