@@ -830,7 +830,7 @@ SQLRETURN SQLFetch(SQLHSTMT stmt) {
830830SQLRETURN SQLExtendedFetch (SQLHSTMT stmt, SQLUSMALLINT fetch_orientation,
831831 SQLLEN fetch_offset, SQLULEN* row_count_ptr,
832832 SQLUSMALLINT* row_status_array) {
833- // GH-47110: SQLExtendedFetch should return SQL_SUCCESS_WITH_INFO for certain diag
833+ // GH-47110 TODO : SQLExtendedFetch should return SQL_SUCCESS_WITH_INFO for certain diag
834834 // states
835835 ARROW_LOG (DEBUG) << " SQLExtendedFetch called with stmt: " << stmt
836836 << " , fetch_orientation: " << fetch_orientation
@@ -842,15 +842,18 @@ SQLRETURN SQLExtendedFetch(SQLHSTMT stmt, SQLUSMALLINT fetch_orientation,
842842 using ODBC::ODBCDescriptor;
843843 using ODBC::ODBCStatement;
844844 return ODBCStatement::ExecuteWithDiagnostics (stmt, SQL_ERROR, [=]() {
845+ // Only SQL_FETCH_NEXT forward-only fetching orientation is supported,
846+ // meaning the behavior of SQLExtendedFetch is same as SQLFetch.
845847 if (fetch_orientation != SQL_FETCH_NEXT) {
846848 throw DriverException (" Optional feature not supported." , " HYC00" );
847849 }
848- // fetch_offset is ignored as only SQL_FETCH_NEXT is supported
850+ // Ignore fetch_offset as it's not applicable to SQL_FETCH_NEXT
851+ ARROW_UNUSED (fetch_offset);
849852
850853 ODBCStatement* statement = reinterpret_cast <ODBCStatement*>(stmt);
851854
852855 // The SQL_ROWSET_SIZE statement attribute specifies the number of rows in the
853- // rowset.
856+ // rowset. Retrieve it from GetRowsetSize.
854857 SQLULEN row_set_size = statement->GetRowsetSize ();
855858 ARROW_LOG (DEBUG) << " SQL_ROWSET_SIZE value for SQLExtendedFetch: " << row_set_size;
856859
0 commit comments