HuaHuaY commented on code in PR #50757:
URL: https://github.com/apache/arrow/pull/50757#discussion_r3701823806


##########
cpp/src/arrow/flight/sql/odbc/odbc_api.cc:
##########
@@ -642,7 +641,7 @@ SQLRETURN SQLGetDiagRec(SQLSMALLINT handle_type, SQLHANDLE 
handle, SQLSMALLINT r
   }
 
   // Convert from ODBC 1 based record number to internal diagnostics 0 indexed 
storage
-  const size_t record_index = static_cast<size_t>(rec_number - 1);
+  const auto record_index = static_cast<uint32_t>(rec_number - 1);
   if (!diagnostics->HasRecord(record_index)) {
     return SQL_NO_DATA;

Review Comment:
   1. The function whose actual argument is `record_index` has a parameter type 
of `uint32_t`, so there is no semantic difference to the original code.
   2. This function has already checked `rec_number < 1` on line 602, so there 
is no need to check it again here.



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