Copilot commented on code in PR #51342:
URL: https://github.com/apache/arrow/pull/51342#discussion_r4278344748
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/odbc_statement.cc:
##########
@@ -571,8 +576,9 @@ void ODBCStatement::SetStmtAttr(SQLINTEGER
statement_attribute, SQLPOINTER value
return;
}
case SQL_ATTR_APP_ROW_DESC: {
- ODBCDescriptor* desc = static_cast<ODBCDescriptor*>(value);
- if (desc && current_ard_ != desc) {
+ ODBCDescriptor* desc =
+ value ? static_cast<ODBCDescriptor*>(value) : built_in_ard_.get();
+ if (current_ard_ != desc) {
Review Comment:
After fetching with the implicit ARD, switching to an explicit ARD and
fetching, then restoring `SQL_NULL_HANDLE`, the implicit ARD's
`HaveBindingsChanged()` flag is still false. The next fetch skips rebinding and
continues writing into the detached explicit descriptor's buffers, potentially
accessing released storage. Mark the incoming ARD's bindings as changed
whenever the active descriptor changes, and add a fetch/reset/fetch regression.
--
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]