Skip to content

[C++][FlightRPC] [ODBC] - SQLCancel does not post a diagnostic record on failure #55816

Backlog

Description

@RekTai

Describe the enhancement requested

SQLCancel currently wraps the call in a bare try/catch and returns SQL_ERROR without posting anything to the statement's Diagnostics, so SQLGetDiagRec/SQLGetDiagField return nothing useful after a failed cancel.

Per the ODBC spec, when SQLCancel cancels a function running on another thread (our primary use case — interrupting a blocked SQLFetch from another thread), no diagnostic information is required. But for other failure cases (e.g. a genuine internal error), the spec expects a diagnostic record with an appropriate SQLSTATE (HY000, HY001, etc.).

SQLCancel was deliberately implemented without ExecuteWithDiagnostics (see dremio/arrow#167) to avoid lock contention and a shared-diagnostics race with an in-progress SQLFetch. Implementing proper diagnostics here needs a way to post to Diagnostics that's safe to call concurrently with the statement's normal diagnostics usage, without reintroducing that same lock contention.

Component(s)

C++, FlightRPC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions