Skip to content
Permalink
Browse files

[CONJ-745] use pool reset only for corrected COM_RESET_CONNECTION

  • Loading branch information
rusher committed Nov 21, 2019
1 parent 93167ab commit f6d27fa82621b15ebce3614025cbd7ba8cf02405
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/org/mariadb/jdbc/MariaDbConnection.java
@@ -1663,10 +1663,16 @@ public void setDefaultTransactionIsolation(int defaultTransactionIsolation) {
* @throws SQLException if resetting operation failed
*/
public void reset() throws SQLException {
// COM_RESET_CONNECTION exist since mysql 5.7.3 and mariadb 10.2.4
// but not possible to use it with mysql waiting for https://bugs.mysql.com/bug.php?id=97633 correction.
// and mariadb only since https://jira.mariadb.org/browse/MDEV-18281
boolean useComReset =
options.useResetConnection
&& ((protocol.isServerMariaDb() && protocol.versionGreaterOrEqual(10, 2, 4))
|| (!protocol.isServerMariaDb() && protocol.versionGreaterOrEqual(5, 7, 3)));
&& protocol.isServerMariaDb()
&& (protocol.versionGreaterOrEqual(10, 3, 13)
|| (protocol.getMajorServerVersion() == 10
&& protocol.getMinorServerVersion() == 2
&& protocol.versionGreaterOrEqual(10, 2, 22)));

if (useComReset) {
protocol.reset();

0 comments on commit f6d27fa

Please sign in to comment.
You can’t perform that action at this time.