Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Nov 21, 2019
2 parents 87946bb + f6d27fa commit 564dfc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ or maven :
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.5.0</version>
<version>2.5.1</version>
</dependency>
```

Expand Down
10 changes: 8 additions & 2 deletions src/main/java/org/mariadb/jdbc/MariaDbConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 564dfc4

Please sign in to comment.