Skip to content

metadata(csharp): GetPrimaryKeys/GetCrossReference identifier case normalization differs (Thrift lowercases, SEA preserves) #528

Description

@eric-wang-1990

Part of #519 (Thrift vs SEA metadata parity).

Problem

get_primary_keys (and get_cross_reference) normalize identifier case differently. When the caller passes uppercase names, the returned identifier columns differ:

Column Thrift SEA
TABLE_NAME "test_result_set_types" "TEST_RESULT_SET_TYPES"
TABLE_SCHEM "oss_jdbc_tests" "OSS_JDBC_TESTS"
TABLE_CAT "comparator_tests" "COMPARATOR_TESTS"

(30 diffs each on get_primary_keys.) Thrift lower-cases / returns the server's canonical name; SEA echoes the caller's casing.

Expected

get_primary_keys / get_cross_reference should return identifier columns with the same casing on both protocols.

How JDBC does it

JDBC's cross-reference adapter compares with case-sensitive .equals() and echoes the caller's casing (no normalization). ADBC should pick one rule — recommend returning the server's canonical (lower-cased) identifiers as Thrift does, since that is what actually exists in the catalog — and apply it on both paths.

Suggested fix

Normalize the returned TABLE_CAT/TABLE_SCHEM/TABLE_NAME casing for keys ops in the shared layer (#519).

Evidence

diff-report-20260615-064733Z.json, get_primary_keys records, where = step[0] / rows[*] / {TABLE_CAT|TABLE_SCHEM|TABLE_NAME}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codebugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions