Copilot commented on code in PR #51342:
URL: https://github.com/apache/arrow/pull/51342#discussion_r4014778819


##########
cpp/src/arrow/flight/sql/odbc/tests/connection_test.cc:
##########
@@ -549,6 +550,18 @@ TYPED_TEST(ConnectionTest, TestSQLSetStmtAttrDescriptor) {
 
   EXPECT_EQ(ard_descriptor, value);
 
+  // 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));

Review Comment:
   The new assertions verify that a null handle selects the implicit 
descriptor, but they do not verify that the outgoing explicit descriptor was 
detached. If `DetachFromStatement` were omitted, this test would still pass; 
freeing that old descriptor later could call `RevertAppDescriptor` and 
overwrite a newer descriptor assignment. Please assign a second explicit 
APD/ARD after the null reset, free the old descriptors, and assert that 
`SQLGetStmtAttr` still returns the second handles.



-- 
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]

Reply via email to