justing-bq commented on code in PR #47788:
URL: https://github.com/apache/arrow/pull/47788#discussion_r2437465316
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/encoding_utils.h:
##########
@@ -80,4 +81,24 @@ inline size_t ConvertToSqlWChar(const std::string& str,
SQLWCHAR* buffer,
}
}
+/// \brief Convert buffer of SqlWchar to standard string
+/// \param[in] wchar_msg SqlWchar to convert
+/// \param[in] msg_len Number of characters in wchar_msg
+/// \return wchar_msg in std::string format
+inline std::string SqlWcharToString(SQLWCHAR* wchar_msg, SQLINTEGER msg_len =
SQL_NTS) {
+ if (!wchar_msg || wchar_msg[0] == 0 || msg_len == 0) {
Review Comment:
Done.
##########
cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc:
##########
@@ -0,0 +1,475 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// For DSN registration. flight_sql_connection.h needs to included first due
to conflicts
+// with windows.h
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h"
+
+#include "arrow/flight/sql/odbc/tests/odbc_test_suite.h"
+
+// For DSN registration
+#include "arrow/flight/sql/odbc/odbc_impl/config/configuration.h"
+#include "arrow/flight/sql/odbc/odbc_impl/encoding_utils.h"
+#include "arrow/flight/sql/odbc/odbc_impl/odbc_connection.h"
+
+namespace arrow::flight::sql::odbc {
+namespace tests {
+
+void FlightSQLODBCRemoteTestBase::AllocEnvConnHandles(SQLINTEGER odbc_ver) {
+ // Allocate an environment handle
+ EXPECT_EQ(SQL_SUCCESS, SQLAllocEnv(&env));
Review Comment:
Done.
--
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]