alinaliBQ commented on code in PR #47971:
URL: https://github.com/apache/arrow/pull/47971#discussion_r2512335262


##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/encoding_utils.h:
##########
@@ -101,4 +100,19 @@ inline std::string SqlWcharToString(SQLWCHAR* wchar_msg, 
SQLINTEGER msg_len = SQ
   return std::string(utf8_str.begin(), utf8_str.end());
 }
 
+inline std::string SqlStringToString(const unsigned char* sql_str,
+                                     int32_t sql_str_len = SQL_NTS) {
+  std::string res;
+
+  const char* sql_str_c = reinterpret_cast<const char*>(sql_str);
+
+  if (!sql_str) return res;
+
+  if (sql_str_len == SQL_NTS)
+    res.assign(sql_str_c);
+  else if (sql_str_len > 0)
+    res.assign(sql_str_c, sql_str_len);

Review Comment:
   Sound good, addressed the comment



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