GH-51341: [C++][FlightRPC][ODBC] Fix statement descriptor and cursor lifecycle - #51342
Open
vikrantpuppala wants to merge 2 commits into
Open
vikrantpuppala wants to merge 2 commits into
vikrantpuppala wants to merge 2 commits into
Conversation
|
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The null-handle tests do not verify that outgoing explicit descriptors are actually detached.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes ODBC statement descriptor ownership and cursor lifecycle behavior.
Changes:
- Corrects implicit ARD initialization and descriptor reset/detachment.
- Adds invalid-cursor diagnostics and closes exhausted result cursors.
- Adds descriptor and cursor lifecycle regression tests.
File summaries
| File | Description |
|---|---|
odbc_statement.cc |
Implements lifecycle fixes. |
connection_test.cc |
Tests descriptor handling. |
statement_test.cc |
Tests cursor diagnostics and closure. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+553
to
+557
| // A null descriptor handle restores the corresponding implicit descriptor. | ||
| EXPECT_EQ(SQL_SUCCESS, | ||
| SQLSetStmtAttr(this->stmt, SQL_ATTR_APP_PARAM_DESC, SQL_NULL_HANDLE, 0)); | ||
| EXPECT_EQ(SQL_SUCCESS, | ||
| SQLSetStmtAttr(this->stmt, SQL_ATTR_APP_ROW_DESC, SQL_NULL_HANDLE, 0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
The Flight SQL ODBC statement implementation had a cluster of related descriptor and cursor lifecycle defects:
SQL_NULL_HANDLEdid not restore built-in application descriptors;SQLFetchandSQLGetDatawithout an open cursor could dereference a null result or report the wrong diagnostic; andSQLMoreResultsdid not close the current cursor when returningSQL_NO_DATA.What changes are included in this PR?
built_in_ard_.24000fromSQLFetchandSQLGetDatawhen no cursor is open.SQLMoreResultsreturnsSQL_NO_DATA.SQLMoreResultscursor 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, andSQLMoreResultscloses the current cursor as required.How was this patch tested?
clang-format19.1.7git diff --checkA 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.