vikrantpuppala opened a new pull request, #51342: URL: https://github.com/apache/arrow/pull/51342
### Rationale for this change The Flight SQL ODBC statement implementation had a cluster of related descriptor and cursor lifecycle defects: - the implicit application row descriptor (ARD) was initialized from the application parameter descriptor (APD), aliasing two descriptor roles; - `SQL_NULL_HANDLE` did not restore built-in application descriptors; - freeing a statement left dangling registrations in explicit descriptors; - `SQLFetch` and `SQLGetData` without an open cursor could dereference a null result or report the wrong diagnostic; and - `SQLMoreResults` did not close the current cursor when returning `SQL_NO_DATA`. ### What changes are included in this PR? - Initialize the active ARD from `built_in_ard_`. - Map null APD/ARD assignments to the corresponding built-in descriptor and detach the outgoing explicit descriptor. - Detach explicit descriptors before releasing a statement. - Return SQLSTATE `24000` from `SQLFetch` and `SQLGetData` when no cursor is open. - Close the current cursor when `SQLMoreResults` returns `SQL_NO_DATA`. - Add public ODBC API regressions for distinct implicit descriptors, null-handle restoration, statement-before-descriptor release order, invalid cursor calls, and `SQLMoreResults` cursor closure. ### Are there any user-facing changes? Yes. Spec-valid descriptor release and reset sequences no longer retain dangling state, invalid cursor operations return SQLSTATE `24000`, and `SQLMoreResults` closes the current cursor as required. ### How was this patch tested? - `clang-format` 19.1.7 - `git diff --check` - Added focused mock/remote typed ODBC regression tests. A fresh local CMake test configuration was blocked before compilation by the host dependency setup (a Boost CMake alias collision followed by unavailable gRPC); the full ODBC suite is left to Arrow CI. Closes #51341. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
