Skip to content

Commit 077666f

Browse files
committed
Extract SQLBindCol implementation
Use `ASSERT` instead of `EXPECT` gtest checks Co-Authored-By: alinalibq <[email protected]>
1 parent e90bacd commit 077666f

File tree

2 files changed

+555
-2
lines changed

2 files changed

+555
-2
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_api.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,8 +1059,16 @@ SQLRETURN SQLBindCol(SQLHSTMT stmt, SQLUSMALLINT record_number, SQLSMALLINT c_ty
10591059
<< ", record_number: " << record_number << ", c_type: " << c_type
10601060
<< ", data_ptr: " << data_ptr << ", buffer_length: " << buffer_length
10611061
<< ", indicator_ptr: " << static_cast<const void*>(indicator_ptr);
1062-
// GH-47716 TODO: Implement SQLBindCol
1063-
return SQL_INVALID_HANDLE;
1062+
1063+
using ODBC::ODBCDescriptor;
1064+
using ODBC::ODBCStatement;
1065+
return ODBCStatement::ExecuteWithDiagnostics(stmt, SQL_ERROR, [=]() {
1066+
// GH-47021 TODO: implement driver to return indicator value when data pointer is null
1067+
ODBCStatement* statement = reinterpret_cast<ODBCStatement*>(stmt);
1068+
ODBCDescriptor* ard = statement->GetARD();
1069+
ard->BindCol(record_number, c_type, data_ptr, buffer_length, indicator_ptr);
1070+
return SQL_SUCCESS;
1071+
});
10641072
}
10651073

10661074
SQLRETURN SQLCloseCursor(SQLHSTMT stmt) {

0 commit comments

Comments
 (0)