Skip to content

Commit

Permalink
Merge branch 'release/3.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Sep 9, 2022
2 parents 3421f52 + 66e6130 commit a3fdec6
Show file tree
Hide file tree
Showing 93 changed files with 844 additions and 451 deletions.
11 changes: 9 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ jdk: openjdk11
addons:
hosts:
- mariadb.example.com
- mariadb1.example.com
- mariadb2.example.com
- mariadb3.example.com

before_install:
- git clone https://github.com/mariadb-corporation/connector-test-machine.git
Expand Down Expand Up @@ -43,7 +46,7 @@ stages:
jobs:
allow_failures:
- env: srv=build
- env: srv=xpand TEST_DB_OTHER="initSql=SET NAMES UTF8"
- env: srv=xpand TEST_DB_OTHER="&initSql=SET NAMES UTF8"
include:
- stage: Minimal
env: srv=mariadb v=10.6 packet=8
Expand All @@ -59,7 +62,7 @@ jobs:
name: "ES 10.5"
- env: srv=maxscale
name: "Maxscale"
- env: srv=xpand TEST_DB_OTHER="initSql=SET NAMES UTF8"
- env: srv=xpand TEST_DB_OTHER="&initSql=SET NAMES UTF8"
name: "Xpand"
- env: srv=skysql
name: "SkySQL"
Expand All @@ -81,13 +84,17 @@ jobs:
name: "CS 10.7"
- env: srv=mariadb v=10.8 local=1
name: "CS 10.8"
- env: srv=mariadb v=10.9 local=1
name: "CS 10.9"
- env: srv=mariadb v=10.6 packet=40
jdk: openjdk17
name: "CS 10.6 - openjdk 17"
- env: srv=mariadb v=10.6 packet=8
name: "CS 10.6 - packet 8M"
- env: srv=mariadb v=10.6 local=1 BENCH=1
name: "Benchmarks"
- env: srv=galera v=10.8
name: "Galera 10.8"
- env: srv=mysql v=5.7
name: "MySQL 5.7"
- env: srv=mysql v=8.0
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# Change Log

## [3.0.7](https://github.com/mariadb-corporation/mariadb-connector-j/tree/3.0.8) (Sept 2022)
[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-j/compare/3.0.7...3.0.8)

##### Notable Changes
* small performance improvement
* [CONJ-1010] improve client side prepared parameter parameter substitution

##### Bugs Fixed
* [CONJ-997] regression in 3.x when using option galeraAllowedState resulting in an IndexOutOfBoundsException
* [CONJ-1002] 2nd failover reconnection ignores default database/schema setting when not set by connection string
* [CONJ-1003] replication configuration always use 1st replica on 3.0
* [CONJ-996] BatchUpdateException doesn't inherited the SQLState & vendorCode from the cause SQL exception
* [CONJ-1006] disabling cachePrepStmts with useServerPrepStmts might result in Exception
* [CONJ-1007] Socket file descriptors are leaked after connecting with unix socket if DB is not up running
* [CONJ-1010] improve client side prepare statement parameter substitution
* [CONJ-999] setting createDatabaseIfNotExist option use on read-only server will refuse connection on 3.0


## [3.0.7](https://github.com/mariadb-corporation/mariadb-connector-j/tree/3.0.7) (Jul 2022)
[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-j/compare/3.0.6...3.0.7)

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ Tracker link <a href="https://jira.mariadb.org/projects/CONJ/issues/">https://ji

## Obtaining the driver

For java 8 or more :
(maintenance branch for java 7 is 1.x)
For java 8+ :

The driver (jar) can be downloaded from [mariadb connector download](https://mariadb.com/downloads/#connectors)
or maven :
```script
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.0.7</version>
<version>3.0.8</version>
</dependency>
```

Expand All @@ -46,7 +45,7 @@ Development snapshot are available on sonatype nexus repository
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>3.0.8-SNAPSHOT</version>
<version>3.0.9-SNAPSHOT</version>
</dependency>
</dependencies>
```
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<artifactId>mariadb-java-client</artifactId>
<packaging>jar</packaging>
<name>mariadb-java-client</name>
<version>3.0.7</version>
<version>3.0.8</version>
<description>JDBC driver for MariaDB and MySQL</description>
<url>https://mariadb.com/kb/en/mariadb/about-mariadb-connector-j/</url>

Expand All @@ -23,7 +23,7 @@
<logback.version>1.3.0-alpha12</logback.version>
<jacoco.version>0.8.7</jacoco.version>
<waffle-jna.version>3.1.1</waffle-jna.version>
<mysql-connector-java.version>8.0.29</mysql-connector-java.version>
<mysql-connector-java.version>8.0.30</mysql-connector-java.version>
<bnd-maven-plugin.version>6.2.0</bnd-maven-plugin.version>
</properties>

Expand Down
3 changes: 1 addition & 2 deletions src/benchmark/java/org/mariadb/jdbc/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Warmup(iterations = 10, timeUnit = TimeUnit.SECONDS, time = 1)
@Measurement(iterations = 10, timeUnit = TimeUnit.SECONDS, time = 1)
@Fork(value = 5)
@Threads(value = -1) // detecting CPU count
@Threads(value = 1) // detecting CPU count
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.SECONDS)
public class Common {
Expand All @@ -42,7 +42,6 @@ public static class MyState {

@Param({"mysql", "mariadb"})
String driver;

@Setup(Level.Trial)
public void createConnections() throws Exception {

Expand Down
21 changes: 21 additions & 0 deletions src/benchmark/java/org/mariadb/jdbc/Do_1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2012-2014 Monty Program Ab
// Copyright (c) 2015-2021 MariaDB Corporation Ab

package org.mariadb.jdbc;

import org.openjdk.jmh.annotations.Benchmark;

import java.sql.ResultSet;
import java.sql.Statement;

public class Do_1 extends Common {

@Benchmark
public int run(MyState state) throws Throwable {
try (Statement st = state.connectionText.createStatement()) {
return st.executeUpdate("DO 1");
}
}

}
43 changes: 43 additions & 0 deletions src/benchmark/java/org/mariadb/jdbc/Do_1000_params.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (c) 2012-2014 Monty Program Ab
// Copyright (c) 2015-2021 MariaDB Corporation Ab

package org.mariadb.jdbc;

import org.openjdk.jmh.annotations.Benchmark;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Do_1000_params extends Common {

private static final String sql;
static {
StringBuilder sb = new StringBuilder("do ?");
for (int i = 1; i < 1000; i++) {
sb.append(",?");
}
sql = sb.toString();
}

@Benchmark
public int text(MyState state) throws Throwable {
return run(state.connectionText);
}

@Benchmark
public int binary(MyState state) throws Throwable {
return run(state.connectionBinary);
}

private int run(Connection con) throws Throwable {

try (PreparedStatement st = con.prepareStatement(sql)) {
for (int i = 1; i <= 1000; i++) {
st.setInt(i, i);
}
return st.executeUpdate();
}
}
}
33 changes: 0 additions & 33 deletions src/benchmark/java/org/mariadb/jdbc/Insert.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/benchmark/java/org/mariadb/jdbc/Select_1.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public class Select_1 extends Common {
@Benchmark
public int run(MyState state) throws Throwable {
try (Statement st = state.connectionText.createStatement()) {
int rnd = (int) (Math.random() * 1000);
ResultSet rs = st.executeQuery("select " + rnd);
ResultSet rs = st.executeQuery("select 1");
rs.next();
return rs.getInt(1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,29 @@
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Select_10000_Rows extends Common {
public class Select_1000_Rows extends Common {
private static final String sql =
"SELECT lpad(conv(floor(rand()*pow(36,8)), 10, 36), 8, 0) as rnd_str_8 FROM seq_1_to_10000";

"select seq, 'abcdefghijabcdefghijabcdefghijaa' from seq_1_to_1000";

@Benchmark
public String[] text(MyState state) throws Throwable {
public int text(MyState state) throws Throwable {
return run(state.connectionText);
}


@Benchmark
public String[] binary(MyState state) throws Throwable {
public int binary(MyState state) throws Throwable {
return run(state.connectionBinary);
}

private String[] run(Connection con) throws Throwable {
private int run(Connection con) throws Throwable {
try (PreparedStatement st = con.prepareStatement(sql)) {

ResultSet rs = st.executeQuery();
String[] res = new String[10000];
int i = 0;
while (rs.next()) {
res[i++] = rs.getString(1);
i = rs.getInt(1);
rs.getString(2);
}
return res;
return i;
}
}
}
57 changes: 0 additions & 57 deletions src/benchmark/java/org/mariadb/jdbc/Select_1000_params.java

This file was deleted.

3 changes: 3 additions & 0 deletions src/main/java/org/mariadb/jdbc/BaseCallableStatement.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public abstract class BaseCallableStatement extends ServerPreparedStatement
* @param procedureName procedure name
* @param canUseServerTimeout indicate if server support server timeout
* @param canUseServerMaxRows indicate if server support server max rows
* @param canCachePrepStmts can cache server prepared result
* @param resultSetType resultset type
* @param resultSetConcurrency resultset concurrency
* @param defaultFetchSize default fetch size
Expand All @@ -60,6 +61,7 @@ public BaseCallableStatement(
String procedureName,
boolean canUseServerTimeout,
boolean canUseServerMaxRows,
boolean canCachePrepStmts,
int resultSetType,
int resultSetConcurrency,
int defaultFetchSize)
Expand All @@ -70,6 +72,7 @@ public BaseCallableStatement(
lock,
canUseServerTimeout,
canUseServerMaxRows,
canCachePrepStmts,
Statement.RETURN_GENERATED_KEYS,
resultSetType,
resultSetConcurrency,
Expand Down
Loading

0 comments on commit a3fdec6

Please sign in to comment.