Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cpp/src/arrow/flight/sql/odbc/odbc_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,16 @@ SQLRETURN SQLBindCol(SQLHSTMT stmt, SQLUSMALLINT record_number, SQLSMALLINT c_ty
<< ", record_number: " << record_number << ", c_type: " << c_type
<< ", data_ptr: " << data_ptr << ", buffer_length: " << buffer_length
<< ", indicator_ptr: " << static_cast<const void*>(indicator_ptr);
// GH-47716 TODO: Implement SQLBindCol
return SQL_INVALID_HANDLE;

using ODBC::ODBCDescriptor;
using ODBC::ODBCStatement;
return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() {
// GH-47021: implement driver to return indicator value when data pointer is null
ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt);
ODBCDescriptor* ard = statement->GetARD();
ard->BindCol(record_number, c_type, data_ptr, buffer_length, indicator_ptr);
return SQL_SUCCESS;
});
}

SQLRETURN SQLCloseCursor(SQLHSTMT stmt) {
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ add_arrow_test(flight_sql_odbc_test
odbc_test_suite.cc
odbc_test_suite.h
connection_test.cc
statement_test.cc
# Enable Protobuf cleanup after test execution
# GH-46889: move protobuf_test_util to a more common location
../../../../engine/substrait/protobuf_test_util.cc
Expand Down
Loading