Skip to content

Commit 60a08ba

Browse files
committed
Merge branch 'release/0.8.3'
2 parents 3c63df7 + 2fb1e09 commit 60a08ba

File tree

153 files changed

+7219
-3337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+7219
-3337
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ matrix:
3838
- env: DB=mariadb:10.2
3939
- env: DB=mariadb:10.3
4040
- env: DB=mariadb:10.4
41+
- env: DB=mariadb:10.4 NO_BACKSLASH_ESCAPES=true
4142
- env: DB=mariadb:10.4 BENCHMARK=1
4243
- env: DB=mariadb:10.5
4344
- env: DB=mariadb:10.4 MAXSCALE_VERSION=2.2.9

.travis/script.sh

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ set -e
66
###################################################################################################################
77
# test different type of configuration
88
###################################################################################################################
9+
if [ -z "NO_BACKSLASH_ESCAPES" ]; then
10+
export NO_BACKSLASH_ESCAPES=false
11+
fi
912

1013
if [ -n "$BENCHMARK" ]; then
1114
cmd=(mvn clean package -P bench -Dmaven.test.skip)
1215
else
1316
mvn clean
14-
cmd=(mvn clean test $ADDITIONNAL_VARIABLES -DjobId=${TRAVIS_JOB_ID} \
17+
cmd=(mvn clean verify $ADDITIONNAL_VARIABLES -DjobId=${TRAVIS_JOB_ID} \
1518
-DkeystorePath="$SSLCERT/client-keystore.jks" \
1619
-DTEST_HOST=mariadb.example.com \
1720
-DTEST_PORT=3305 \
@@ -20,6 +23,7 @@ else
2023
-DRUN_LONG_TEST=false \
2124
-DkeystorePassword="kspass" \
2225
-DserverCertificatePath="$SSLCERT/server.crt" \
26+
-DNO_BACKSLASH_ESCAPES="$NO_BACKSLASH_ESCAPES"
2327
-Dkeystore2Path="$SSLCERT/fullclient-keystore.jks" \
2428
-Dkeystore2Password="kspass" -DkeyPassword="kspasskey" \
2529
-Dkeystore2PathP12="$SSLCERT/fullclient-keystore.p12" \
@@ -66,7 +70,36 @@ if [ "$i" = 0 ]; then
6670
echo >&2 'data server init process failed.'
6771
exit 1
6872
fi
73+
###################################################################################################################
74+
# run test suite
75+
###################################################################################################################
6976

77+
if [ -z "$MAXSCALE_VERSION" ] ; then
78+
docker-compose -f .travis/docker-compose.yml exec -u root db bash /docker-entrypoint-initdb.d/pam/pam.sh
79+
sleep 2
80+
docker-compose -f .travis/docker-compose.yml stop db
81+
sleep 2
82+
docker-compose -f .travis/docker-compose.yml up -d
83+
docker-compose -f .travis/docker-compose.yml logs db
84+
85+
for i in {60..0}; do
86+
if echo 'SELECT 1' | "${mysql[@]}" &>/dev/null; then
87+
break
88+
fi
89+
echo 'data server still not active'
90+
sleep 1
91+
done
92+
93+
if [ "$i" = 0 ]; then
94+
if [ -n "COMPOSE_FILE" ]; then
95+
docker-compose -f ${COMPOSE_FILE} logs
96+
fi
97+
98+
echo 'SELECT 1' | "${mysql[@]}"
99+
echo >&2 'data server init process failed.'
100+
exit 1
101+
fi
102+
fi
70103
###################################################################################################################
71104
# run test suite
72105
###################################################################################################################

.travis/sql/pam/pam.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
tee /etc/pam.d/mariadb << EOF
4+
auth required pam_unix.so audit
5+
auth required pam_unix.so audit
6+
account required pam_unix.so audit
7+
EOF
8+
9+
useradd testPam
10+
chpasswd << EOF
11+
testPam:myPwd
12+
EOF
13+
14+
usermod -a -G shadow mysql
15+
16+
echo "pam configuration done"

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
# Change Log
2+
## [0.8.3](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/tree/0.8.3) (23 Jul 2020)
3+
[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/compare/0.8.2...0.8.3)
4+
5+
First Beta release.
6+
7+
This version had a strong focus on testing coverage (40%->85%).
8+
9+
Changes compared to 0.8.2.alpha1:
10+
* Corrections and optimisations
11+
* new option `pamOtherPwd` to permit PAM authentication with multiple steps.
12+
* Rely on 0.8.2 specification (was 0.8.1)
13+
214

315
## [0.8.2](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/tree/0.8.2) (08 May 2020)
416
[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/compare/0.8.1...0.8.2)

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ MariaDB and MySQL client, 100% Java, compatible with Java8+, apache 2.0 licensed
1818
- Driver permits ed25519, PAM authentication that comes with MariaDB.
1919
- use MariaDB 10.5 returning fonction to permit Statement.returnGeneratedValues
2020

21-
Driver follow [R2DBC 0.8.1 specifications](https://r2dbc.io/spec/0.8.1.RELEASE/spec/html/)
21+
Driver follow [R2DBC 0.8.2 specifications](https://r2dbc.io/spec/0.8.2.RELEASE/spec/html/)
2222

2323

2424
## Quick Start
@@ -29,7 +29,7 @@ The MariaDB Connector is available through maven using :
2929
<dependency>
3030
<groupId>org.mariadb</groupId>
3131
<artifactId>r2dbc-mariadb</artifactId>
32-
<version>0.8.2-alpha2</version>
32+
<version>0.8.3-beta1</version>
3333
</dependency>
3434
```
3535

@@ -95,9 +95,10 @@ Basic example:
9595
| **`rsaPublicKey`** | <i>only for MySQL server</i><br/> Server RSA public key, for SHA256 authentication |*String* | |
9696
| **`cachingRsaPublicKey`** | <i>only for MySQL server</i><br/> Server caching RSA public key, for cachingSHA256 authentication |*String* | |
9797
| **`allowPublicKeyRetrieval`** | <i>only for MySQL server</i><br/> Permit retrieved Server RSA public key from server. This can create a security issue |*boolean* | true |
98-
| **`allowPipelining`** | Permit to send queries to server without waiting for previous query to finish |*boolean* | |
99-
| **`useServerPrepStmts`** | Permit to indicate to use text or binary protocol for query with parameter |*boolean* |false |
100-
| **`prepareCacheSize`** | if useServerPrepStmts = true, cache the prepared informations in a LRU cache to avoid re-preparation of command. Next use of that command, only prepared identifier and parameters (if any) will be sent to server. This mainly permit for server to avoid reparsing query. |*int* |256 |
98+
| **`allowPipelining`** | Permit to send queries to server without waiting for previous query to finish |*boolean* | true |
99+
| **`useServerPrepStmts`** | Permit to indicate to use text or binary protocol for query with parameter |*boolean* | false |
100+
| **`prepareCacheSize`** | if useServerPrepStmts = true, cache the prepared informations in a LRU cache to avoid re-preparation of command. Next use of that command, only prepared identifier and parameters (if any) will be sent to server. This mainly permit for server to avoid reparsing query. |*int* |256 |
101+
| **`pamOtherPwd`** | Permit to provide additional password for PAM authentication with multiple authentication step. If multiple passwords, value must be URL encoded.|*string* | |
101102
102103
## Roadmap
103104

@@ -112,11 +113,11 @@ Basic example:
112113
To file an issue or follow the development, see [JIRA](https://jira.mariadb.org/projects/R2DBC/issues/).
113114

114115

115-
[travis-image]:https://travis-ci.org/mariadb-corporation/mariadb-connector-r2dbc.svg?branch=master
116-
[travis-url]:https://travis-ci.org/mariadb-corporation/mariadb-connector-r2dbc
117-
[maven-image]:https://maven-badges.herokuapp.com/maven-central/org.mariadb/r2dbc-mariadb/badge.svg
116+
[travis-image]:https://travis-ci.com/mariadb-corporation/mariadb-connector-r2dbc.svg?branch=master
117+
[travis-url]:https://travis-ci.com/mariadb-corporation/mariadb-connector-r2dbc
118+
[maven-image]:https://maven-badges.herokuapp.com/maven-central/org.mariadb/r2dbc-maria
118119
[maven-url]:https://maven-badges.herokuapp.com/maven-central/org.mariadb/r2dbc-mariadb
119-
[appveyor-image]:https://ci.appveyor.com/api/projects/status/hbfar9vg8w0rw15f/branch/master
120-
[appveyor-url]:https://ci.appveyor.com/project/rusher/mariadb-connector-r2dbc-57na3
120+
[appveyor-image]:https://ci.appveyor.com/api/projects/status/hbfar9vg8w0rw15f/branch/master?svg=true
121+
[appveyor-url]:https://ci.appveyor.com/project/rusher/mariadb-connector-r2dbc-57na3/branch/master
121122
[license-image]:https://img.shields.io/badge/License-Apache%202.0-blue.svg
122123
[license-url]:https://opensource.org/licenses/Apache-2.0

appveyor.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
version: '{build}'
22
environment:
33
matrix:
4-
- DB: '10.2.31'
4+
- DB: '10.2.32'
55
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
66
CMAKE_PARAM: 'Visual Studio 15 2017 Win64'
77
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
88

9-
- DB: '10.3.22'
9+
- DB: '10.3.23'
1010
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
1111
CMAKE_PARAM: 'Visual Studio 15 2017 Win64'
1212
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
1313

14-
- DB: '10.4.12'
14+
- DB: '10.4.13'
1515
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
1616
CMAKE_PARAM: 'Visual Studio 15 2017 Win64'
1717
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
1818

19-
- DB: '10.5.1'
19+
- DB: '10.5.4'
2020
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
2121
CMAKE_PARAM: 'Visual Studio 15 2017 Win64'
2222
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
2323

24-
- DB: '10.1.44'
25-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
26-
CMAKE_PARAM: 'Visual Studio 15 2017 Win64'
27-
JAVA_HOME: C:\Program Files\Java\jdk1.8.0
28-
29-
- DB: '5.5.67'
24+
- DB: '10.1.45'
3025
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
3126
CMAKE_PARAM: 'Visual Studio 15 2017 Win64'
3227
JAVA_HOME: C:\Program Files\Java\jdk1.8.0

pom.xml

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<modelVersion>4.0.0</modelVersion>
2323
<groupId>org.mariadb</groupId>
2424
<artifactId>r2dbc-mariadb</artifactId>
25-
<version>0.8.2-alpha2</version>
25+
<version>0.8.3-beta1</version>
2626
<packaging>jar</packaging>
2727
<url>https://github.com/mariadb-corporation/mariadb-connector-r2dbc</url>
2828

@@ -36,11 +36,11 @@
3636
<junit.version>5.6.2</junit.version>
3737
<jmh.version>1.23</jmh.version>
3838
<logback.version>1.2.3</logback.version>
39-
<netty.version>4.1.48.Final</netty.version>
39+
<netty.version>4.1.49.Final</netty.version>
4040
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41-
<r2dbc-spi.version>0.8.1.RELEASE</r2dbc-spi.version>
42-
<reactor.version>Dysprosium-SR6</reactor.version>
43-
<mariadb-jdbc.version>2.6.0</mariadb-jdbc.version>
41+
<r2dbc-spi.version>0.8.2.RELEASE</r2dbc-spi.version>
42+
<reactor.version>Dysprosium-SR9</reactor.version>
43+
<mariadb-jdbc.version>2.6.1</mariadb-jdbc.version>
4444
<r2dbc-mysql.version>0.8.1.RELEASE</r2dbc-mysql.version>
4545
<uberjar.name>benchmarks</uberjar.name>
4646
</properties>
@@ -179,30 +179,31 @@
179179

180180
<build>
181181
<plugins>
182-
<!-- <plugin>-->
183-
<!-- <groupId>org.jacoco</groupId>-->
184-
<!-- <artifactId>jacoco-maven-plugin</artifactId>-->
185-
<!-- <version>0.8.5</version>-->
186-
<!-- <configuration>-->
187-
<!-- <includes>-->
188-
<!-- <include>org.mariadb.r2dbc.*</include>-->
189-
<!-- </includes>-->
190-
<!-- </configuration>-->
191-
<!-- <executions>-->
192-
<!-- <execution>-->
193-
<!-- <goals>-->
194-
<!-- <goal>prepare-agent</goal>-->
195-
<!-- </goals>-->
196-
<!-- </execution>-->
197-
<!-- <execution>-->
198-
<!-- <id>report</id>-->
199-
<!-- <phase>test</phase>-->
200-
<!-- <goals>-->
201-
<!-- <goal>report</goal>-->
202-
<!-- </goals>-->
203-
<!-- </execution>-->
204-
<!-- </executions>-->
205-
<!-- </plugin>-->
182+
<plugin>
183+
<groupId>org.jacoco</groupId>
184+
<artifactId>jacoco-maven-plugin</artifactId>
185+
<version>0.8.5</version>
186+
<configuration>
187+
<includes>
188+
<include>org/mariadb/r2dbc</include>
189+
<include>org/mariadb/r2dbc/**</include>
190+
</includes>
191+
</configuration>
192+
<executions>
193+
<execution>
194+
<goals>
195+
<goal>prepare-agent</goal>
196+
</goals>
197+
</execution>
198+
<execution>
199+
<id>report</id>
200+
<phase>test</phase>
201+
<goals>
202+
<goal>report</goal>
203+
</goals>
204+
</execution>
205+
</executions>
206+
</plugin>
206207
<plugin>
207208
<groupId>org.apache.maven.plugins</groupId>
208209
<artifactId>maven-compiler-plugin</artifactId>
@@ -298,7 +299,7 @@
298299
<version>1.6</version>
299300
<executions>
300301
<execution>
301-
<phase>verify</phase>
302+
<phase>install</phase>
302303
<goals>
303304
<goal>sign</goal>
304305
</goals>

src/benchmark/java/org/mariadb/r2dbc/Common.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@
3030
@State(Scope.Benchmark)
3131
@Warmup(iterations = 10, timeUnit = TimeUnit.SECONDS, time = 1)
3232
@Measurement(iterations = 10, timeUnit = TimeUnit.SECONDS, time = 1)
33-
@Fork(value = 1)
33+
@Fork(value = 5)
3434
@Threads(value = -1) // detecting CPU count
3535
@BenchmarkMode(Mode.AverageTime)
3636
@OutputTimeUnit(TimeUnit.MICROSECONDS)
37+
@Timeout(timeUnit = TimeUnit.SECONDS, time = 2)
3738
public class Common {
3839

3940
@State(Scope.Thread)

src/main/java/org/mariadb/r2dbc/ExceptionFactory.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,4 @@ public void handleErrorResponse(ServerMessage message, SynchronousSink<ServerMes
8585
sink.next(message);
8686
}
8787
}
88-
89-
@Override
90-
public String toString() {
91-
return "ExceptionFactory{" + "sql='" + sql + '\'' + '}';
92-
}
9388
}

src/main/java/org/mariadb/r2dbc/MariadbBatch.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public MariadbBatch add(String sql) {
5353
@Override
5454
public Flux<MariadbResult> execute() {
5555
if (configuration.allowMultiQueries()) {
56-
return new MariadbSimpleQueryStatement(this.client, String.join("; ", this.statements))
56+
return new MariadbSimpleQueryStatement(this.client, String.join(";", this.statements))
5757
.execute();
5858
} else {
5959

@@ -78,13 +78,7 @@ public Flux<MariadbResult> execute() {
7878
dataRow,
7979
ExceptionFactory.INSTANCE,
8080
null,
81-
client.getVersion().isMariaDBServer()
82-
&& client.getVersion().versionGreaterOrEqual(10, 5, 1)));
81+
client.getVersion().supportReturning()));
8382
}
8483
}
85-
86-
@Override
87-
public String toString() {
88-
return "MariadbBatch{client=" + this.client + ", statements=" + this.statements + '}';
89-
}
9084
}

0 commit comments

Comments
 (0)