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


##########
cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc:
##########
@@ -0,0 +1,865 @@
+// 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.
+#include "arrow/flight/sql/odbc/tests/odbc_test_suite.h"
+
+#include "arrow/flight/sql/odbc/odbc_impl/platform.h"
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+#include <gtest/gtest.h>
+
+namespace arrow::flight::sql::odbc {
+
+template <typename T>
+class ConnectionInfoTest : public T {};
+
+class ConnectionInfoMockTest : public FlightSQLODBCMockTestBase {};
+using TestTypes = ::testing::Types<ConnectionInfoMockTest, 
FlightSQLODBCRemoteTestBase>;
+TYPED_TEST_SUITE(ConnectionInfoTest, TestTypes);
+
+namespace {
+// Helper Functions
+
+// Validate unsigned short SQLUSMALLINT return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLUSMALLINT 
expected_value) {
+  SQLUSMALLINT info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate unsigned long SQLUINTEGER return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLUINTEGER 
expected_value) {
+  SQLUINTEGER info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate unsigned length SQLULEN return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLULEN 
expected_value) {
+  SQLULEN info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate wchar string SQLWCHAR return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type,
+              const SQLWCHAR* expected_value) {
+  SQLWCHAR info_value[kOdbcBufferSize] = L"";
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS, SQLGetInfo(connection, info_type, info_value, 
kOdbcBufferSize,
+                                    &message_length));
+
+  EXPECT_EQ(*expected_value, *info_value);
+}
+
+// Validate unsigned long SQLUINTEGER return value is greater than
+void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type,
+                         SQLUINTEGER compared_value) {
+  SQLUINTEGER info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_GT(info_value, compared_value);
+}
+
+// Validate unsigned length SQLULEN return value is greater than
+void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type,
+                         SQLULEN compared_value) {

Review Comment:
   @lidavidm I have fixed and added the utility getters, please have another 
look, thanks!



##########
cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc:
##########
@@ -0,0 +1,865 @@
+// 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.
+#include "arrow/flight/sql/odbc/tests/odbc_test_suite.h"
+
+#include "arrow/flight/sql/odbc/odbc_impl/platform.h"
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+#include <gtest/gtest.h>
+
+namespace arrow::flight::sql::odbc {
+
+template <typename T>
+class ConnectionInfoTest : public T {};
+
+class ConnectionInfoMockTest : public FlightSQLODBCMockTestBase {};
+using TestTypes = ::testing::Types<ConnectionInfoMockTest, 
FlightSQLODBCRemoteTestBase>;
+TYPED_TEST_SUITE(ConnectionInfoTest, TestTypes);
+
+namespace {
+// Helper Functions
+
+// Validate unsigned short SQLUSMALLINT return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLUSMALLINT 
expected_value) {
+  SQLUSMALLINT info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate unsigned long SQLUINTEGER return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLUINTEGER 
expected_value) {
+  SQLUINTEGER info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate unsigned length SQLULEN return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLULEN 
expected_value) {
+  SQLULEN info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate wchar string SQLWCHAR return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type,
+              const SQLWCHAR* expected_value) {
+  SQLWCHAR info_value[kOdbcBufferSize] = L"";
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS, SQLGetInfo(connection, info_type, info_value, 
kOdbcBufferSize,
+                                    &message_length));
+
+  EXPECT_EQ(*expected_value, *info_value);
+}
+
+// Validate unsigned long SQLUINTEGER return value is greater than
+void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type,
+                         SQLUINTEGER compared_value) {
+  SQLUINTEGER info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_GT(info_value, compared_value);
+}
+
+// Validate unsigned length SQLULEN return value is greater than
+void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type,
+                         SQLULEN compared_value) {
+  SQLULEN info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_GT(info_value, compared_value);
+}
+
+// Validate wchar string SQLWCHAR return value is not empty
+void ValidateNotEmptySQLWCHAR(SQLHDBC connection, SQLUSMALLINT info_type,
+                              bool allow_truncation) {
+  SQLWCHAR info_value[kOdbcBufferSize] = L"";
+  SQLSMALLINT message_length;
+
+  SQLRETURN ret =
+      SQLGetInfo(connection, info_type, info_value, kOdbcBufferSize, 
&message_length);
+  if (allow_truncation && ret == SQL_SUCCESS_WITH_INFO) {
+    ASSERT_EQ(SQL_SUCCESS_WITH_INFO, ret);
+  } else {
+    ASSERT_EQ(SQL_SUCCESS, ret);
+  }
+
+  EXPECT_GT(wcslen(info_value), 0);
+}
+}  // namespace
+
+// Driver Information
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoActiveEnvironments) {
+  Validate(this->conn, SQL_ACTIVE_ENVIRONMENTS, static_cast<SQLUSMALLINT>(0));
+}
+
+#ifdef SQL_ASYNC_DBC_FUNCTIONS
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAsyncDbcFunctions) {
+  Validate(this->conn, SQL_ASYNC_DBC_FUNCTIONS,
+           static_cast<SQLUINTEGER>(SQL_ASYNC_DBC_NOT_CAPABLE));
+}
+#endif
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAsyncMode) {
+  Validate(this->conn, SQL_ASYNC_MODE, static_cast<SQLUINTEGER>(SQL_AM_NONE));
+}
+
+#ifdef SQL_ASYNC_NOTIFICATION
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAsyncNotification) {
+  Validate(this->conn, SQL_ASYNC_NOTIFICATION,
+           static_cast<SQLUINTEGER>(SQL_ASYNC_NOTIFICATION_NOT_CAPABLE));
+}
+#endif
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoBatchRowCount) {
+  Validate(this->conn, SQL_BATCH_ROW_COUNT, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoBatchSupport) {
+  Validate(this->conn, SQL_BATCH_SUPPORT, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDataSourceName) {
+  Validate(this->conn, SQL_DATA_SOURCE_NAME, static_cast<const 
SQLWCHAR*>(L""));
+}
+
+#ifdef SQL_DRIVER_AWARE_POOLING_SUPPORTED
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverAwarePoolingSupported) {
+  // According to Microsoft documentation, ODBC driver does not need to 
implement
+  // SQL_DRIVER_AWARE_POOLING_SUPPORTED and the Driver Manager will ignore the
+  // driver's return value for it.
+
+  Validate(this->conn, SQL_DRIVER_AWARE_POOLING_SUPPORTED,
+           static_cast<SQLUINTEGER>(SQL_DRIVER_AWARE_POOLING_NOT_CAPABLE));
+}
+#endif
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHdbc) {
+  // Value returned from driver manager is the connection address
+  ValidateGreaterThan(this->conn, SQL_DRIVER_HDBC, static_cast<SQLULEN>(0));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHdesc) {
+  SQLHDESC descriptor;
+
+  // Allocate a descriptor using alloc handle
+  ASSERT_EQ(SQL_SUCCESS, SQLAllocHandle(SQL_HANDLE_DESC, this->conn, 
&descriptor));
+
+  // Value returned from driver manager is the desc address
+  SQLHDESC local_desc = descriptor;
+  SQLRETURN ret = SQLGetInfo(this->conn, SQL_HANDLE_DESC, &local_desc, 0, 0);
+  EXPECT_EQ(SQL_SUCCESS, ret);
+  EXPECT_GT(local_desc, static_cast<SQLHSTMT>(0));
+
+  // Free descriptor handle
+  ASSERT_EQ(SQL_SUCCESS, SQLFreeHandle(SQL_HANDLE_DESC, descriptor));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHenv) {
+  // Value returned from driver manager is the env address
+  ValidateGreaterThan(this->conn, SQL_DRIVER_HENV, static_cast<SQLULEN>(0));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHlib) {
+  ValidateGreaterThan(this->conn, SQL_DRIVER_HLIB, static_cast<SQLULEN>(0));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHstmt) {
+  // Value returned from driver manager is the stmt address
+  SQLHSTMT local_stmt = this->stmt;
+  ASSERT_EQ(SQL_SUCCESS, SQLGetInfo(this->conn, SQL_DRIVER_HSTMT, &local_stmt, 
0, 0));
+  EXPECT_GT(local_stmt, static_cast<SQLHSTMT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverName) {
+  Validate(this->conn, SQL_DRIVER_NAME,
+           static_cast<const SQLWCHAR*>(L"Arrow Flight ODBC Driver"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverOdbcVer) {
+  Validate(this->conn, SQL_DRIVER_ODBC_VER, static_cast<const 
SQLWCHAR*>(L"03.80"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverVer) {
+  Validate(this->conn, SQL_DRIVER_VER, static_cast<const 
SQLWCHAR*>(L"00.09.0000.0"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDynamicCursorAttributes1) {
+  Validate(this->conn, SQL_DYNAMIC_CURSOR_ATTRIBUTES1, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDynamicCursorAttributes2) {
+  Validate(this->conn, SQL_DYNAMIC_CURSOR_ATTRIBUTES2, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoForwardOnlyCursorAttributes1) {
+  Validate(this->conn, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1,
+           static_cast<SQLUINTEGER>(SQL_CA1_NEXT));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoForwardOnlyCursorAttributes2) {
+  Validate(this->conn, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2,
+           static_cast<SQLUINTEGER>(SQL_CA2_READ_ONLY_CONCURRENCY));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoFileUsage) {
+  Validate(this->conn, SQL_FILE_USAGE, 
static_cast<SQLUSMALLINT>(SQL_FILE_NOT_SUPPORTED));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoGetDataExtensions) {
+  Validate(this->conn, SQL_GETDATA_EXTENSIONS,
+           static_cast<SQLUINTEGER>(SQL_GD_ANY_COLUMN | SQL_GD_ANY_ORDER));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoSchemaViews) {
+  Validate(this->conn, SQL_INFO_SCHEMA_VIEWS,
+           static_cast<SQLUINTEGER>(SQL_ISV_TABLES | SQL_ISV_COLUMNS | 
SQL_ISV_VIEWS));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeysetCursorAttributes1) {
+  Validate(this->conn, SQL_KEYSET_CURSOR_ATTRIBUTES1, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeysetCursorAttributes2) {
+  Validate(this->conn, SQL_KEYSET_CURSOR_ATTRIBUTES2, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMaxAsyncConcurrentStatements) {
+  Validate(this->conn, SQL_MAX_ASYNC_CONCURRENT_STATEMENTS, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMaxConcurrentActivities) {
+  Validate(this->conn, SQL_MAX_CONCURRENT_ACTIVITIES, 
static_cast<SQLUSMALLINT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMaxDriverConnections) {
+  Validate(this->conn, SQL_MAX_DRIVER_CONNECTIONS, 
static_cast<SQLUSMALLINT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoOdbcInterfaceConformance) {
+  Validate(this->conn, SQL_ODBC_INTERFACE_CONFORMANCE,
+           static_cast<SQLUINTEGER>(SQL_OIC_CORE));
+}
+
+// case SQL_ODBC_STANDARD_CLI_CONFORMANCE: - mentioned in SQLGetInfo spec with 
no
+// description and there is no constant for this.
+TYPED_TEST(ConnectionInfoTest, 
DISABLED_TestSQLGetInfoOdbcStandardCliConformance) {

Review Comment:
   removed



##########
cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc:
##########
@@ -0,0 +1,865 @@
+// 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.
+#include "arrow/flight/sql/odbc/tests/odbc_test_suite.h"
+
+#include "arrow/flight/sql/odbc/odbc_impl/platform.h"
+
+#include <sql.h>
+#include <sqltypes.h>
+#include <sqlucode.h>
+
+#include <gtest/gtest.h>
+
+namespace arrow::flight::sql::odbc {
+
+template <typename T>
+class ConnectionInfoTest : public T {};
+
+class ConnectionInfoMockTest : public FlightSQLODBCMockTestBase {};
+using TestTypes = ::testing::Types<ConnectionInfoMockTest, 
FlightSQLODBCRemoteTestBase>;
+TYPED_TEST_SUITE(ConnectionInfoTest, TestTypes);
+
+namespace {
+// Helper Functions
+
+// Validate unsigned short SQLUSMALLINT return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLUSMALLINT 
expected_value) {
+  SQLUSMALLINT info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate unsigned long SQLUINTEGER return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLUINTEGER 
expected_value) {
+  SQLUINTEGER info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate unsigned length SQLULEN return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type, SQLULEN 
expected_value) {
+  SQLULEN info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_EQ(expected_value, info_value);
+}
+
+// Validate wchar string SQLWCHAR return value
+void Validate(SQLHDBC connection, SQLUSMALLINT info_type,
+              const SQLWCHAR* expected_value) {
+  SQLWCHAR info_value[kOdbcBufferSize] = L"";
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS, SQLGetInfo(connection, info_type, info_value, 
kOdbcBufferSize,
+                                    &message_length));
+
+  EXPECT_EQ(*expected_value, *info_value);
+}
+
+// Validate unsigned long SQLUINTEGER return value is greater than
+void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type,
+                         SQLUINTEGER compared_value) {
+  SQLUINTEGER info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_GT(info_value, compared_value);
+}
+
+// Validate unsigned length SQLULEN return value is greater than
+void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type,
+                         SQLULEN compared_value) {
+  SQLULEN info_value;
+  SQLSMALLINT message_length;
+
+  ASSERT_EQ(SQL_SUCCESS,
+            SQLGetInfo(connection, info_type, &info_value, 0, 
&message_length));
+
+  EXPECT_GT(info_value, compared_value);
+}
+
+// Validate wchar string SQLWCHAR return value is not empty
+void ValidateNotEmptySQLWCHAR(SQLHDBC connection, SQLUSMALLINT info_type,
+                              bool allow_truncation) {
+  SQLWCHAR info_value[kOdbcBufferSize] = L"";
+  SQLSMALLINT message_length;
+
+  SQLRETURN ret =
+      SQLGetInfo(connection, info_type, info_value, kOdbcBufferSize, 
&message_length);
+  if (allow_truncation && ret == SQL_SUCCESS_WITH_INFO) {
+    ASSERT_EQ(SQL_SUCCESS_WITH_INFO, ret);
+  } else {
+    ASSERT_EQ(SQL_SUCCESS, ret);
+  }
+
+  EXPECT_GT(wcslen(info_value), 0);
+}
+}  // namespace
+
+// Driver Information
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoActiveEnvironments) {
+  Validate(this->conn, SQL_ACTIVE_ENVIRONMENTS, static_cast<SQLUSMALLINT>(0));
+}
+
+#ifdef SQL_ASYNC_DBC_FUNCTIONS
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAsyncDbcFunctions) {
+  Validate(this->conn, SQL_ASYNC_DBC_FUNCTIONS,
+           static_cast<SQLUINTEGER>(SQL_ASYNC_DBC_NOT_CAPABLE));
+}
+#endif
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAsyncMode) {
+  Validate(this->conn, SQL_ASYNC_MODE, static_cast<SQLUINTEGER>(SQL_AM_NONE));
+}
+
+#ifdef SQL_ASYNC_NOTIFICATION
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAsyncNotification) {
+  Validate(this->conn, SQL_ASYNC_NOTIFICATION,
+           static_cast<SQLUINTEGER>(SQL_ASYNC_NOTIFICATION_NOT_CAPABLE));
+}
+#endif
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoBatchRowCount) {
+  Validate(this->conn, SQL_BATCH_ROW_COUNT, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoBatchSupport) {
+  Validate(this->conn, SQL_BATCH_SUPPORT, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDataSourceName) {
+  Validate(this->conn, SQL_DATA_SOURCE_NAME, static_cast<const 
SQLWCHAR*>(L""));
+}
+
+#ifdef SQL_DRIVER_AWARE_POOLING_SUPPORTED
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverAwarePoolingSupported) {
+  // According to Microsoft documentation, ODBC driver does not need to 
implement
+  // SQL_DRIVER_AWARE_POOLING_SUPPORTED and the Driver Manager will ignore the
+  // driver's return value for it.
+
+  Validate(this->conn, SQL_DRIVER_AWARE_POOLING_SUPPORTED,
+           static_cast<SQLUINTEGER>(SQL_DRIVER_AWARE_POOLING_NOT_CAPABLE));
+}
+#endif
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHdbc) {
+  // Value returned from driver manager is the connection address
+  ValidateGreaterThan(this->conn, SQL_DRIVER_HDBC, static_cast<SQLULEN>(0));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHdesc) {
+  SQLHDESC descriptor;
+
+  // Allocate a descriptor using alloc handle
+  ASSERT_EQ(SQL_SUCCESS, SQLAllocHandle(SQL_HANDLE_DESC, this->conn, 
&descriptor));
+
+  // Value returned from driver manager is the desc address
+  SQLHDESC local_desc = descriptor;
+  SQLRETURN ret = SQLGetInfo(this->conn, SQL_HANDLE_DESC, &local_desc, 0, 0);
+  EXPECT_EQ(SQL_SUCCESS, ret);
+  EXPECT_GT(local_desc, static_cast<SQLHSTMT>(0));
+
+  // Free descriptor handle
+  ASSERT_EQ(SQL_SUCCESS, SQLFreeHandle(SQL_HANDLE_DESC, descriptor));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHenv) {
+  // Value returned from driver manager is the env address
+  ValidateGreaterThan(this->conn, SQL_DRIVER_HENV, static_cast<SQLULEN>(0));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHlib) {
+  ValidateGreaterThan(this->conn, SQL_DRIVER_HLIB, static_cast<SQLULEN>(0));
+}
+
+// These information types are implemented by the Driver Manager alone.
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverHstmt) {
+  // Value returned from driver manager is the stmt address
+  SQLHSTMT local_stmt = this->stmt;
+  ASSERT_EQ(SQL_SUCCESS, SQLGetInfo(this->conn, SQL_DRIVER_HSTMT, &local_stmt, 
0, 0));
+  EXPECT_GT(local_stmt, static_cast<SQLHSTMT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverName) {
+  Validate(this->conn, SQL_DRIVER_NAME,
+           static_cast<const SQLWCHAR*>(L"Arrow Flight ODBC Driver"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverOdbcVer) {
+  Validate(this->conn, SQL_DRIVER_ODBC_VER, static_cast<const 
SQLWCHAR*>(L"03.80"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDriverVer) {
+  Validate(this->conn, SQL_DRIVER_VER, static_cast<const 
SQLWCHAR*>(L"00.09.0000.0"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDynamicCursorAttributes1) {
+  Validate(this->conn, SQL_DYNAMIC_CURSOR_ATTRIBUTES1, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDynamicCursorAttributes2) {
+  Validate(this->conn, SQL_DYNAMIC_CURSOR_ATTRIBUTES2, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoForwardOnlyCursorAttributes1) {
+  Validate(this->conn, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1,
+           static_cast<SQLUINTEGER>(SQL_CA1_NEXT));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoForwardOnlyCursorAttributes2) {
+  Validate(this->conn, SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2,
+           static_cast<SQLUINTEGER>(SQL_CA2_READ_ONLY_CONCURRENCY));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoFileUsage) {
+  Validate(this->conn, SQL_FILE_USAGE, 
static_cast<SQLUSMALLINT>(SQL_FILE_NOT_SUPPORTED));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoGetDataExtensions) {
+  Validate(this->conn, SQL_GETDATA_EXTENSIONS,
+           static_cast<SQLUINTEGER>(SQL_GD_ANY_COLUMN | SQL_GD_ANY_ORDER));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoSchemaViews) {
+  Validate(this->conn, SQL_INFO_SCHEMA_VIEWS,
+           static_cast<SQLUINTEGER>(SQL_ISV_TABLES | SQL_ISV_COLUMNS | 
SQL_ISV_VIEWS));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeysetCursorAttributes1) {
+  Validate(this->conn, SQL_KEYSET_CURSOR_ATTRIBUTES1, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoKeysetCursorAttributes2) {
+  Validate(this->conn, SQL_KEYSET_CURSOR_ATTRIBUTES2, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMaxAsyncConcurrentStatements) {
+  Validate(this->conn, SQL_MAX_ASYNC_CONCURRENT_STATEMENTS, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMaxConcurrentActivities) {
+  Validate(this->conn, SQL_MAX_CONCURRENT_ACTIVITIES, 
static_cast<SQLUSMALLINT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMaxDriverConnections) {
+  Validate(this->conn, SQL_MAX_DRIVER_CONNECTIONS, 
static_cast<SQLUSMALLINT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoOdbcInterfaceConformance) {
+  Validate(this->conn, SQL_ODBC_INTERFACE_CONFORMANCE,
+           static_cast<SQLUINTEGER>(SQL_OIC_CORE));
+}
+
+// case SQL_ODBC_STANDARD_CLI_CONFORMANCE: - mentioned in SQLGetInfo spec with 
no
+// description and there is no constant for this.
+TYPED_TEST(ConnectionInfoTest, 
DISABLED_TestSQLGetInfoOdbcStandardCliConformance) {
+  // Type commented out in odbc_connection.cc
+  // Type does not exist in sql.h
+  // Validate(this->conn, SQL_ODBC_STANDARD_CLI_CONFORMANCE,
+  // static_cast<SQLUSMALLINT>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoOdbcVer) {
+  // This is implemented only in the Driver Manager.
+
+  Validate(this->conn, SQL_ODBC_VER, static_cast<const 
SQLWCHAR*>(L"03.80.0000"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoParamArrayRowCounts) {
+  Validate(this->conn, SQL_PARAM_ARRAY_ROW_COUNTS,
+           static_cast<SQLUINTEGER>(SQL_PARC_NO_BATCH));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoParamArraySelects) {
+  Validate(this->conn, SQL_PARAM_ARRAY_SELECTS,
+           static_cast<SQLUINTEGER>(SQL_PAS_NO_SELECT));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoRowUpdates) {
+  Validate(this->conn, SQL_ROW_UPDATES, static_cast<const SQLWCHAR*>(L"N"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoSearchPatternEscape) {
+  Validate(this->conn, SQL_SEARCH_PATTERN_ESCAPE, static_cast<const 
SQLWCHAR*>(L"\\"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoServerName) {
+  ValidateNotEmptySQLWCHAR(this->conn, SQL_SERVER_NAME, false);
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoStaticCursorAttributes1) {
+  Validate(this->conn, SQL_STATIC_CURSOR_ATTRIBUTES1, 
static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoStaticCursorAttributes2) {
+  Validate(this->conn, SQL_STATIC_CURSOR_ATTRIBUTES2, 
static_cast<SQLUINTEGER>(0));
+}
+
+// DBMS Product Information
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDatabaseName) {
+  Validate(this->conn, SQL_DATABASE_NAME, static_cast<const SQLWCHAR*>(L""));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDbmsName) {
+  ValidateNotEmptySQLWCHAR(this->conn, SQL_DBMS_NAME, false);
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDbmsVer) {
+  ValidateNotEmptySQLWCHAR(this->conn, SQL_DBMS_VER, false);
+}
+
+// Data Source Information
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAccessibleProcedures) {
+  Validate(this->conn, SQL_ACCESSIBLE_PROCEDURES, static_cast<const 
SQLWCHAR*>(L"N"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAccessibleTables) {
+  Validate(this->conn, SQL_ACCESSIBLE_TABLES, static_cast<const 
SQLWCHAR*>(L"Y"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoBookmarkPersistence) {
+  Validate(this->conn, SQL_BOOKMARK_PERSISTENCE, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoCatalogTerm) {
+  Validate(this->conn, SQL_CATALOG_TERM, static_cast<const SQLWCHAR*>(L""));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoCollationSeq) {
+  Validate(this->conn, SQL_COLLATION_SEQ, static_cast<const SQLWCHAR*>(L""));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoConcatNullBehavior) {
+  Validate(this->conn, SQL_CONCAT_NULL_BEHAVIOR, 
static_cast<SQLUSMALLINT>(SQL_CB_NULL));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoCursorCommitBehavior) {
+  Validate(this->conn, SQL_CURSOR_COMMIT_BEHAVIOR,
+           static_cast<SQLUSMALLINT>(SQL_CB_CLOSE));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoCursorRollbackBehavior) {
+  Validate(this->conn, SQL_CURSOR_ROLLBACK_BEHAVIOR,
+           static_cast<SQLUSMALLINT>(SQL_CB_CLOSE));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoCursorSensitivity) {
+  Validate(this->conn, SQL_CURSOR_SENSITIVITY, 
static_cast<SQLUINTEGER>(SQL_UNSPECIFIED));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDataSourceReadOnly) {
+  Validate(this->conn, SQL_DATA_SOURCE_READ_ONLY, static_cast<const 
SQLWCHAR*>(L"N"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDefaultTxnIsolation) {
+  Validate(this->conn, SQL_DEFAULT_TXN_ISOLATION, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoDescribeParameter) {
+  Validate(this->conn, SQL_DESCRIBE_PARAMETER, static_cast<const 
SQLWCHAR*>(L"N"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMultResultSets) {
+  Validate(this->conn, SQL_MULT_RESULT_SETS, static_cast<const 
SQLWCHAR*>(L"N"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoMultipleActiveTxn) {
+  Validate(this->conn, SQL_MULTIPLE_ACTIVE_TXN, static_cast<const 
SQLWCHAR*>(L"N"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoNeedLongDataLen) {
+  Validate(this->conn, SQL_NEED_LONG_DATA_LEN, static_cast<const 
SQLWCHAR*>(L"N"));
+}
+
+TEST_F(ConnectionInfoMockTest, TestSQLGetInfoNullCollation) {
+  Validate(this->conn, SQL_NULL_COLLATION, 
static_cast<SQLUSMALLINT>(SQL_NC_START));
+}
+
+TEST_F(ConnectionInfoMockTest, TestSQLGetInfoProcedureTerm) {
+  Validate(this->conn, SQL_PROCEDURE_TERM, static_cast<const SQLWCHAR*>(L""));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoSchemaTerm) {
+  Validate(this->conn, SQL_SCHEMA_TERM, static_cast<const 
SQLWCHAR*>(L"schema"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoScrollOptions) {
+  Validate(this->conn, SQL_SCROLL_OPTIONS, 
static_cast<SQLUINTEGER>(SQL_SO_FORWARD_ONLY));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoTableTerm) {
+  Validate(this->conn, SQL_TABLE_TERM, static_cast<const SQLWCHAR*>(L"table"));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoTxnCapable) {
+  Validate(this->conn, SQL_TXN_CAPABLE, 
static_cast<SQLUSMALLINT>(SQL_TC_NONE));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoTxnIsolationOption) {
+  Validate(this->conn, SQL_TXN_ISOLATION_OPTION, static_cast<SQLUINTEGER>(0));
+}
+
+TEST_F(ConnectionInfoMockTest, TestSQLGetInfoUserName) {
+  Validate(this->conn, SQL_USER_NAME, static_cast<const SQLWCHAR*>(L""));
+}
+
+// Supported SQL
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAggregateFunctions) {
+  Validate(
+      this->conn, SQL_AGGREGATE_FUNCTIONS,
+      static_cast<SQLUINTEGER>(SQL_AF_ALL | SQL_AF_AVG | SQL_AF_COUNT | 
SQL_AF_DISTINCT |
+                               SQL_AF_MAX | SQL_AF_MIN | SQL_AF_SUM));
+}
+
+TYPED_TEST(ConnectionInfoTest, TestSQLGetInfoAlterDomain) {
+  Validate(this->conn, SQL_ALTER_DOMAIN, static_cast<SQLUINTEGER>(0));
+}
+
+TYPED_TEST(ConnectionInfoTest, DISABLED_TestSQLGetInfoAlterSchema) {

Review Comment:
   removed



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