Skip to content

Commit

Permalink
Merge branch 'develop' into pull/133
Browse files Browse the repository at this point in the history
# Conflicts:
#	pom.xml
  • Loading branch information
rusher committed Oct 10, 2019
2 parents 1d83166 + a5486a5 commit e242f8c
Show file tree
Hide file tree
Showing 324 changed files with 22,323 additions and 17,230 deletions.
90 changes: 43 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:
- echo "MAVEN_OPTS='-Xmx384m'" > ~/.mavenrc

install:
# generate SSL certificates
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
- mkdir tmp
- .travis/gen-ssl.sh mariadb.example.com tmp
- export PROJ_PATH=`pwd`
Expand All @@ -28,62 +28,58 @@ cache:
matrix:
allow_failures:
- env: DB=build PACKET=8M
jdk: oraclejdk8
- env: DB=mysql:8.0 PACKET=8M ADDITIONAL_CONF=--default-authentication-plugin=mysql_native_password
jdk: oraclejdk8
- env: DB=mariadb:10.4 PACKET=8M
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mysql:8.0 PACKET=8M ADDITIONAL_CONF=--default-authentication-plugin=mysql_native_password --caching_sha2_password_private_key_path=/etc/sslcert/server.key --caching_sha2_password_public_key_path=/etc/sslcert/public.key
jdk: openjdk11
include:
- env: DB=build PACKET=8M
jdk: oraclejdk8
- env: AURORA=true
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mysql:5.5 PACKET=8M
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mysql:5.6 PACKET=8M
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mysql:5.7 PACKET=8M
jdk: oraclejdk8
- env: DB=mysql:8.0 PACKET=8M ADDITIONAL_CONF=--default-authentication-plugin=mysql_native_password
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mysql:8.0 PACKET=8M ADDITIONAL_CONF=--default-authentication-plugin=mysql_native_password --caching_sha2_password_private_key_path=/etc/sslcert/server.key --caching_sha2_password_public_key_path=/etc/sslcert/public.key
jdk: openjdk11
- env: DB=mariadb:5.5 PACKET=8M
jdk: oraclejdk8
- env: DB=mariadb:10.0 PACKET=8M
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mariadb:10.1 PACKET=8M
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=8M
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mariadb:10.2 PACKET=8M
jdk: oraclejdk11
- env: DB=mariadb:10.2 PACKET=8M GALERA=true
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=8M PROFILE=true
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=8M TYPE=PREPARE
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=8M TYPE=REWRITE
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=8M TYPE=MULTI
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=20M
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=40M
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=40M TYPE=BULK_SERVER
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=40M TYPE=NO_BULK_CLIENT
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=40M TYPE=NO_BULK_SERVER
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=40M COMPRESSION=true
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mariadb:10.3 PACKET=8M
jdk: oraclejdk8
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M
jdk: oraclejdk11
- env: DB=mariadb:10.4 PACKET=8M
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M GALERA=true
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M PROFILE=true
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M TYPE=PREPARE
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M TYPE=REWRITE
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M TYPE=MULTI
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=20M
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=40M
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=40M TYPE=BULK_SERVER
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=40M TYPE=NO_BULK_CLIENT
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=40M TYPE=NO_BULK_SERVER
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=40M COMPRESSION=true
jdk: openjdk11
- env: DB=mariadb:10.4 PACKET=8M
jdk: oraclejdk8
- env: DB=mariadb:10.2 PACKET=8M MAXSCALE_VERSION=2.2.9
jdk: oraclejdk8
jdk: openjdk12
- env: DB=mariadb:10.4 PACKET=8M MAXSCALE_VERSION=2.2.9
jdk: openjdk11

script:
- if [ "$DB" = "build" ] ; then .travis/build/build.sh; fi
Expand Down
29 changes: 23 additions & 6 deletions .travis/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
FROM debian:jessie
# vim:set ft=dockerfile:
FROM ubuntu:bionic

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mysql && useradd -r -g mysql mysql

# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
RUN set -ex; \
apt-get update; \
if ! which gpg; then \
apt-get install -y --no-install-recommends gnupg; \
fi; \
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
if ! gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
apt-get install -y --no-install-recommends dirmngr; \
fi; \
rm -rf /var/lib/apt/lists/*

# add gosu for easy step-down from root
ENV GOSU_VERSION 1.10
RUN set -ex; \
Expand All @@ -21,8 +35,9 @@ RUN set -ex; \
\
# verify the signature
export GNUPGHOME="$(mktemp -d)"; \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
command -v gpgconf > /dev/null && gpgconf --kill all || :; \
rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
\
chmod +x /usr/local/bin/gosu; \
Expand All @@ -37,6 +52,7 @@ RUN mkdir /docker-entrypoint-initdb.d
# install "apt-transport-https" for Percona's repo (switched to https-only)
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https ca-certificates \
tzdata \
pwgen \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -48,16 +64,17 @@ RUN { \
RUN apt-get update -y
RUN apt-get install -y software-properties-common wget
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
RUN echo 'deb http://yum.mariadb.org/galera/repo/deb jessie main' > /etc/apt/sources.list.d/galera-test-repo.list
RUN apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net F1656F24C74CD1D8
RUN echo 'deb http://yum.mariadb.org/galera/repo/deb bionic main' > /etc/apt/sources.list.d/galera-test-repo.list
RUN apt-get update -y

RUN apt-get install -y curl libdbi-perl rsync socat galera3 libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1 libcrack2
RUN apt-get install -y curl libdbi-perl rsync socat galera3 libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2

COPY *.deb /root/
RUN chmod 777 /root/*

RUN dpkg -R --install /root/mysql-common*
RUN dpkg -R --install /root/mariadb-common*
RUN dpkg --install /root/mysql-common*
RUN dpkg --install /root/mariadb-common*
RUN dpkg -R --unpack /root/
RUN apt-get install -f -y

Expand Down
6 changes: 3 additions & 3 deletions .travis/build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ echo "**************************************************************************
wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.4/
grep -o ">build-[0-9]*" index.html | grep -o "[0-9]*" | tac | while read -r line ; do

curl -s --head http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-jessie-amd64/md5sums.txt | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null
curl -s --head http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/md5sums.txt | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null
if [ $? = "0" ]; then
echo "**************************************************************************"
echo "* Processing $line"
echo "**************************************************************************"
wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-jessie-amd64/debs/binary/
wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/debs/binary/
grep -o ">[^\"]*\.deb" $line.html | grep -o "[^>]*\.deb" | while read -r file ; do
if [[ "$file" =~ ^mariadb-plugin.* ]] ;
then
echo "skipped file: $file"
else
echo "download file: $file"
wget -q -o /dev/null -O .travis/build/$file http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-jessie-amd64/debs/binary/$file
wget -q -o /dev/null -O .travis/build/$file http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/debs/binary/$file
fi
done

Expand Down
21 changes: 13 additions & 8 deletions .travis/build/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ _check_config() {
toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" )
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
cat >&2 <<-EOM
ERROR: mysqld failed while attempting to check config
command was: "${toRun[*]}"
$errors
EOM
exit 1
Expand All @@ -59,15 +57,17 @@ _check_config() {
# latter only show values present in config files, and not server defaults
_get_config() {
local conf="$1"; shift
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }'
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
| awk '$1 == "'"$conf"'" && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
}

# allow the container to be started with `--user`
if [ "$1" = 'mysqld' -a -z "$wantHelp" -a "$(id -u)" = '0' ]; then
_check_config "$@"
DATADIR="$(_get_config 'datadir' "$@")"
mkdir -p "$DATADIR"
chown -R mysql:mysql "$DATADIR"
find "$DATADIR" \! -user mysql -exec chown mysql '{}' +
exec gosu mysql "$BASH_SOURCE" "$@"
fi

Expand All @@ -88,7 +88,15 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
mkdir -p "$DATADIR"

echo 'Initializing database'
mysql_install_db --datadir="$DATADIR" --rpm
installArgs=( --datadir="$DATADIR" --rpm )
if { mysql_install_db --help || :; } | grep -q -- '--auth-root-authentication-method'; then
# beginning in 10.4.3, install_db uses "socket" which only allows system user root to connect, switch back to "normal" to allow mysql root without a password
# see https://github.com/MariaDB/server/commit/b9f3f06857ac6f9105dc65caae19782f09b47fb3
# (this flag doesn't exist in 10.0 and below)
installArgs+=( --auth-root-authentication-method=normal )
fi
# "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here)
mysql_install_db "${installArgs[@]}" "${@:2}"
echo 'Database initialized'

SOCKET="$(_get_config 'socket' "$@")"
Expand Down Expand Up @@ -135,7 +143,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
-- What's done in this file shouldn't be replicated
-- or products like mysql-fabric won't work
SET @@SESSION.SQL_LOG_BIN=0;
DELETE FROM mysql.user WHERE user NOT IN ('mysql.sys', 'mysqlxsys', 'root') OR host NOT IN ('localhost') ;
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ;
GRANT ALL ON *.* TO 'root'@'localhost' WITH GRANT OPTION ;
Expand All @@ -162,8 +169,6 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
if [ "$MYSQL_DATABASE" ]; then
echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* TO '$MYSQL_USER'@'%' ;" | "${mysql[@]}"
fi

echo 'FLUSH PRIVILEGES ;' | "${mysql[@]}"
fi

echo
Expand Down
4 changes: 4 additions & 0 deletions .travis/gen-ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ main () {
local caKeyFile="${sslDir}/ca.key"
local certFile="${sslDir}/server.crt"
local keyFile="${sslDir}/server.key"
local pubkeyFile="${sslDir}/public.key"
local csrFile=$(mktemp)
local clientCertFile="${sslDir}/client.crt"
local clientKeyFile="${sslDir}/client.key"
Expand All @@ -56,6 +57,9 @@ main () {
log "Generating private key"
openssl genrsa -out "${keyFile}" 2048

log "Generating public key"
openssl rsa -in "${keyFile}" -pubout -out "${pubkeyFile}"

log "Generating certificate signing request"
openssl req \
-new \
Expand Down
8 changes: 4 additions & 4 deletions .travis/maxscale/maxscale.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ monitor_interval=10000

[Read-OnlyService]
enable_root_user=1
version_string=10.2.99-MariaDB-maxScale
version_string=10.4.99-MariaDB-maxScale
type=service
router=readconnroute
servers=server1
Expand All @@ -63,7 +63,7 @@ localhost_match_wildcard_host=1

[Read-WriteService]
enable_root_user=1
version_string=10.2.99-MariaDB-maxScale
version_string=10.4.99-MariaDB-maxScale
type=service
router=readwritesplit
servers=server1
Expand All @@ -79,7 +79,7 @@ user=boby
passwd=hey
router_options=master
localhost_match_wildcard_host=1
version_string=10.2.99-MariaDB-maxscale
version_string=10.4.99-MariaDB-maxscale


# This service enables the use of the MaxAdmin interface
Expand All @@ -88,7 +88,7 @@ version_string=10.2.99-MariaDB-maxscale

[MaxAdminService]
enable_root_user=1
version_string=10.2.99-MariaDB-maxScale
version_string=10.4.99-MariaDB-maxScale
type=service
router=cli

Expand Down
5 changes: 3 additions & 2 deletions .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ cmd=( mvn clean test $ADDITIONNAL_VARIABLES -DjobId=${TRAVIS_JOB_ID} \
-Dkeystore2Path="$SSLCERT/fullclient-keystore.jks" \
-Dkeystore2Password="kspass" -DkeyPassword="kspasskey" \
-Dkeystore2PathP12="$SSLCERT/fullclient-keystore.p12" \
-DrunLongTest=true )
-DrunLongTest=true \
-DserverPublicKey="$SSLCERT/public.key" )

if [ -n "$AURORA" ] ; then
if [ -n "$AURORA_STRING_URL" ] ; then
Expand Down Expand Up @@ -83,7 +84,7 @@ else
export COMPOSE_FILE=.travis/galera-compose.yml

urlString='jdbc:mariadb://mariadb.example.com:3106/testj?user=bob&enablePacketDebug=true'
cmd+=( -DdefaultGaleraUrl="jdbc:mariadb:failover://mariadb.example.com:3106,mariadb.example.com:3107,mariadb.example.com:3108/testj?user=bob&enablePacketDebug=true" )
cmd+=( -DdefaultGaleraUrl="jdbc:mariadb:sequential://mariadb.example.com:3106,mariadb.example.com:3107,mariadb.example.com:3108/testj?user=bob&enablePacketDebug=true" -DdefaultSequentialUrl="jdbc:mariadb:sequential://mariadb.example.com:3106,mariadb.example.com:3107,mariadb.example.com:3108/testj?user=bob&enablePacketDebug=true" -DdefaultLoadbalanceUrl="jdbc:mariadb:loadbalance://mariadb.example.com:3106,mariadb.example.com:3107,mariadb.example.com:3108/testj?user=bob&enablePacketDebug=true" )
docker-compose -f ${COMPOSE_FILE} up -d
SLEEP 10
else
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Tracker link <a href="https://jira.mariadb.org/projects/CONJ/issues/">https://ji
[![Windows Build](https://ci.appveyor.com/api/projects/status/7hpe3wmbu57r8noa/branch/master?svg=true)](https://ci.appveyor.com/project/rusher/mariadb-connector-j/branch/master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.mariadb.jdbc/mariadb-java-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.mariadb.jdbc/mariadb-java-client)
[![License (LGPL version 2.1)](https://img.shields.io/badge/license-GNU%20LGPL%20version%202.1-green.svg?style=flat-square)](http://opensource.org/licenses/LGPL-2.1)
[![Known Vulnerabilities](https://snyk.io/test/github/mariadb/mariadb-connector-j/badge.svg)](https://snyk.io/test/github/mariadb/mariadb-connector-j)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/be7f4c89d63e496d824e8f365478e8c8)](https://www.codacy.com/app/diego-dupin/mariadb-connector-j?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=MariaDB/mariadb-connector-j&amp;utm_campaign=Badge_Grade)

## Obtaining the driver
Expand All @@ -24,15 +23,15 @@ Tracker link <a href="https://jira.mariadb.org/projects/CONJ/issues/">https://ji
|:------------:|:-------------------------:|
| 6 | 1.7.4 |
| 7 | 1.7.4 |
| 8+ | 2.4.0 |
| 8+ | 2.5.0 |

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

Expand All @@ -50,7 +49,7 @@ Development snapshot are available on sonatype nexus repository
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.5.0-SNAPSHOT</version>
<version>2.6.0-SNAPSHOT</version>
</dependency>
</dependencies>
```
Expand Down
Loading

0 comments on commit e242f8c

Please sign in to comment.