Merge bugfix #2546 from poco-1.9.1 (#2548)

* Merge bugfix #2546 from poco-1.9.1

* Fixed ODBC SessionImpl

* Fixed missing methods in PostresSQL and testsuit

* Fixed missing method in SQLite SessionImpl

* Use mysql_refresh() instead of mysql_reset_connection()

* 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:
Erbengi
2018-11-27 15:29:40 +01:00
committed by Aleksandar Fabijanic
parent e60ece37d4
commit 759b4dd164
16 changed files with 69 additions and 1 deletions

View File

@@ -176,4 +176,15 @@ void SessionHandle::rollback()
}
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)
#endif
throw TransactionException("Reset connection failed.", _pHandle);
}
}}} // Poco::SQL::MySQL