diff --git a/src/IntegrationTests/ITODBCExecution/test_odbc_execution.cpp b/src/IntegrationTests/ITODBCExecution/test_odbc_execution.cpp index 1042b220d..48db05d73 100644 --- a/src/IntegrationTests/ITODBCExecution/test_odbc_execution.cpp +++ b/src/IntegrationTests/ITODBCExecution/test_odbc_execution.cpp @@ -83,6 +83,8 @@ class TestSQLPrepare : public Fixture {}; class TestSQLDescribeParam : public Fixture {}; +class TestSQLNumParams : public Fixture {}; + /*class TestSQLSetCursorName : public testing::Test { public: TestSQLSetCursorName() { @@ -253,6 +255,16 @@ TEST_F(TestSQLDescribeParam, DESCRIBE_PARAM) { LogAnyDiagnostics(SQL_HANDLE_STMT, m_hstmt, ret); } +TEST_F(TestSQLNumParams, NUM_PARAMS) { + SQLSMALLINT num = 0; + SQLRETURN ret = SQLNumParams(nullptr, &num); + EXPECT_EQ(SQL_ERROR, ret); + ret = SQLNumParams(m_hstmt, &num); + EXPECT_EQ(SQL_SUCCESS_WITH_INFO, ret); + EXPECT_TRUE(CheckSQLSTATE(SQL_HANDLE_STMT, m_hstmt, SQLSTATE_NOT_IMPLEMENTED_ERROR)); + LogAnyDiagnostics(SQL_HANDLE_STMT, m_hstmt, ret); +} + TEST_F(TestSQLFetch, INVALID_HANDLE) { EXPECT_EQ(SQL_INVALID_HANDLE, SQLFetch(nullptr)); } diff --git a/src/IntegrationTests/ITODBCHelper/it_odbc_helper.h b/src/IntegrationTests/ITODBCHelper/it_odbc_helper.h index 19cd9b4fd..394bf17ba 100644 --- a/src/IntegrationTests/ITODBCHelper/it_odbc_helper.h +++ b/src/IntegrationTests/ITODBCHelper/it_odbc_helper.h @@ -38,6 +38,7 @@ #define SQLSTATE_INVALID_STRING_OR_BUFFER_LENGTH (SQLWCHAR*)L"HY090" #define SQLSTATE_INVALID_DESCRIPTOR_FIELD_IDENTIFIER (SQLWCHAR*)L"HY091" #define SQLSTATE_NUMERIC_VALUE_OUT_OF_RANGE (SQLWCHAR*) L"HY019" +#define SQLSTATE_NOT_IMPLEMENTED_ERROR (SQLWCHAR*)L"HYC00" #define SQLSTATE_STRING_CONVERSION_ERROR (SQLWCHAR*)L"22018" #define SQLSTATE_INVALID_CURSUR_STATE (SQLWCHAR*)L"07005" #define SQLSTATE_FRACTIONAL_TRUNCATION (SQLWCHAR*)L"01S07"