Skip to content

test(c/validation): assert GetInfo all-codes result covers explicitly requested codes - #23

Open
fornwall wants to merge 1 commit into
mainfrom
validation/getinfo-all-codes
Open

test(c/validation): assert GetInfo all-codes result covers explicitly requested codes#23
fornwall wants to merge 1 commit into
mainfrom
validation/getinfo-all-codes

Conversation

@fornwall

Copy link
Copy Markdown
Owner

Split out from #21 (2/5).

Adds ConnectionTest.MetadataGetInfoAllCodes to the generic C++ validation suite: any info code a driver answers when explicitly requested must also appear in the GetInfo(NULL) (all-codes) result.

  • adbc-spanner finding: SPEC-5 (get_info(None) returns a curated subset while explicit requests answer more codes)
  • Spec reference: adbc.h doc for AdbcConnectionGetInfo (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.
  • Expected on current adbc-spanner: FAIL — explicit requests for codes 1 (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).
  • On SQLite: passes; guarded by supports_get_sql_info() so drivers without GetInfo skip.

The test is written against the generic DriverQuirks fixtures, so it auto-enrolls for every driver using ADBCV_TEST_CONNECTION; candidate for later upstream submission to apache/arrow-adbc.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EGHTnNywAfCfbe4DoNcfuz

… 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
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>
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