mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-14 02:57:45 +01:00
Fixed PostgreSQL SessionImpl, use mysql_reset_connection() if it is
available Use mysql_reset_connection() only if MySQL version is >= 5.7 or MariaDB version is >= 3.0.0 otherwise fall back to myslq_refresh()
This commit is contained in:
parent
fc5f1684d5
commit
8d4dee26ea
@ -178,7 +178,11 @@ void SessionHandle::rollback()
|
|||||||
|
|
||||||
void SessionHandle::reset()
|
void SessionHandle::reset()
|
||||||
{
|
{
|
||||||
|
#if ((defined (MYSQL_VERSION_ID)) && (MYSQL_VERSION_ID >= 50700)) || ((defined (MARIADB_PACKAGE_VERSION_ID)) && (MARIADB_PACKAGE_VERSION_ID >= 30000))
|
||||||
|
if (mysql_reset_connection(_pHandle) != 0)
|
||||||
|
#else
|
||||||
if (mysql_refresh(_pHandle, REFRESH_TABLES | REFRESH_STATUS | REFRESH_THREADS | REFRESH_READ_LOCK) != 0)
|
if (mysql_refresh(_pHandle, REFRESH_TABLES | REFRESH_STATUS | REFRESH_THREADS | REFRESH_READ_LOCK) != 0)
|
||||||
|
#endif
|
||||||
throw TransactionException("Reset connection failed.", _pHandle);
|
throw TransactionException("Reset connection failed.", _pHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +62,9 @@ public:
|
|||||||
void close();
|
void close();
|
||||||
/// Closes the connection.
|
/// Closes the connection.
|
||||||
|
|
||||||
|
void reset();
|
||||||
|
/// Do nothing
|
||||||
|
|
||||||
bool isConnected() const;
|
bool isConnected() const;
|
||||||
/// Returns true if connected, false otherwise.
|
/// Returns true if connected, false otherwise.
|
||||||
|
|
||||||
|
@ -151,6 +151,12 @@ void SessionImpl::close()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SessionImpl::reset()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SessionImpl::isConnected() const
|
bool SessionImpl::isConnected() const
|
||||||
{
|
{
|
||||||
return _sessionHandle.isConnected();
|
return _sessionHandle.isConnected();
|
||||||
|
Loading…
Reference in New Issue
Block a user