mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-22 08:02:06 +02:00
merge dev and resolve conflicts
This commit is contained in:
@@ -55,8 +55,17 @@ void StatementExecutor::prepare(const std::string& query)
|
||||
return;
|
||||
}
|
||||
|
||||
if (mysql_stmt_prepare(_pHandle, query.c_str(), static_cast<unsigned int>(query.length())) != 0)
|
||||
throw StatementException("mysql_stmt_prepare error", _pHandle, query);
|
||||
int rc = mysql_stmt_prepare(_pHandle, query.c_str(), static_cast<unsigned int>(query.length()));
|
||||
if (rc != 0)
|
||||
{
|
||||
// retry if connection lost
|
||||
int err = mysql_errno(_pSessionHandle);
|
||||
if (err == 2006 /* CR_SERVER_GONE_ERROR */ || err == 2013 /* CR_SERVER_LOST */)
|
||||
{
|
||||
rc = mysql_stmt_prepare(_pHandle, query.c_str(), static_cast<unsigned int>(query.length()));
|
||||
}
|
||||
}
|
||||
if (rc != 0) throw StatementException("mysql_stmt_prepare error", _pHandle, query);
|
||||
|
||||
_query = query;
|
||||
_state = STMT_COMPILED;
|
||||
|
@@ -18,4 +18,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS WINCE
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
target_link_libraries( ${TESTUNIT} PocoDataSQLite PocoData PocoFoundation PocoCppUnit )
|
||||
|
||||
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoDataSQLite PocoData PocoFoundation PocoCppUnit )
|
||||
|
||||
|
@@ -23,4 +23,6 @@ POCO_SOURCES_AUTO_PLAT( TEST_SRCS OFF
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
|
||||
target_link_libraries( ${TESTUNIT} PocoData PocoUtil PocoXML PocoFoundation PocoCppUnit)
|
||||
|
||||
target_link_libraries( ${TESTUNIT} ${CMAKE_THREAD_LIBS_INIT} PocoData PocoUtil PocoXML PocoFoundation PocoCppUnit)
|
||||
|
||||
|
Reference in New Issue
Block a user