Skip to content

[C++][FlightRPC][ODBC] Fix statement descriptor and cursor lifecycle #51341

Description

@vikrantpuppala

Describe the bug, including details regarding any error messages, version, and platform.

The Flight SQL ODBC statement implementation has several related descriptor and cursor lifecycle defects:

  • The active application row descriptor (ARD) is initialized from the built-in application parameter descriptor (APD), so the implicit ARD and APD alias each other.
  • Setting SQL_ATTR_APP_PARAM_DESC or SQL_ATTR_APP_ROW_DESC to SQL_NULL_HANDLE does not restore the corresponding implicit descriptor or detach the explicit descriptor.
  • Freeing a statement does not detach it from explicit descriptors, leaving dangling statement pointers that are dereferenced if the descriptors are freed later.
  • SQLFetch and SQLGetData without an open cursor can dereference a null result set or return the wrong diagnostic instead of SQLSTATE 24000.
  • SQLMoreResults returns SQL_NO_DATA without closing the current cursor.

These are generic framework defects and reproduce on current main.

Component(s)

C++, FlightRPC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions