mirror of
https://github.com/mariadb-corporation/mariadb-connector-cpp.git
synced 2025-08-15 20:45:46 +00:00
CONCPP-6 The fix and the testcase
The connector wour throw on getParameterCount, if the query was w/out parameters. Also, getParameterMetaData would not throw on closed PS. Adding parameter metadata testsuite.
This commit is contained in:
@ -178,6 +178,7 @@ ENDIF(WIN32)
|
||||
ADD_EXECUTABLE(test_parametermetadata ${test_parametermetadata_sources})
|
||||
SET_TARGET_PROPERTIES(test_parametermetadata PROPERTIES
|
||||
OUTPUT_NAME "parametermetadata"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/test"
|
||||
LINK_FLAGS "${MYSQLCPPCONN_LINK_FLAGS_ENV} ${MYSQL_LINK_FLAGS}"
|
||||
COMPILE_FLAGS "${MYSQLCPPCONN_COMPILE_FLAGS_ENV}")
|
||||
TARGET_LINK_LIBRARIES(test_parametermetadata ${LIBRARY_NAME} ${PLATFORM_DEPENDENCIES} test_framework ${MY_GCOV_LINK_LIBRARIES})
|
||||
|
@ -84,7 +84,7 @@ void parametermetadata::getParameterCount()
|
||||
{
|
||||
pstmt.reset(con->prepareStatement("SELECT 1"));
|
||||
parameta = (pstmt->getParameterMetaData());
|
||||
parameta->getParameterCount();
|
||||
ASSERT_EQUALS(parameta->getParameterCount(), 0U);
|
||||
pstmt->close();
|
||||
}
|
||||
catch (sql::SQLException &e)
|
||||
@ -100,7 +100,7 @@ void parametermetadata::getParameterCount()
|
||||
pstmt->getParameterMetaData();
|
||||
FAIL("Closed connection not detected");
|
||||
}
|
||||
catch (...)//sql::InvalidInstanceException&)
|
||||
catch (sql::SQLException&)//sql::InvalidInstanceException&)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user