Skip to content

Commit a596445

Browse files
committed
Merge branch 'release/2.0.4'
2 parents 5eabc1b + 54c2f13 commit a596445

File tree

138 files changed

+11177
-7859
lines changed

Some content is hidden

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

138 files changed

+11177
-7859
lines changed

.eslintrc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
"globals": {
33
"expect": true
44
},
5-
"extends": [
6-
"prettier"
7-
],
85
"plugins": [
96
"markdown"
107
],
8+
"extends": [
9+
"prettier",
10+
"plugin:prettier/recommended"
11+
],
1112
"parserOptions": {
1213
"ecmaVersion": 6
1314
},
1415
"env": {
1516
"node": true,
1617
"es6": true
18+
},
19+
"rules": {
20+
"linebreak-style": ["error", "unix"]
1721
}
1822
}

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"printWidth": 80,
5+
"semi": true,
6+
"singleQuote": true,
7+
"endOfLine": "lf"
8+
}

.travis.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@ before_install:
1515
- chmod +x .travis/script.sh
1616

1717
install:
18-
# generate SSL certificates
19-
- mkdir tmp
20-
- chmod +x .travis/gen-ssl.sh
21-
- chmod +x .travis/build/build.sh
22-
- chmod +x .travis/build/docker-entrypoint.sh
23-
- chmod 777 .travis/build/
24-
- .travis/gen-ssl.sh mariadb.example.com tmp
25-
- export PROJ_PATH=`pwd`
26-
- export SSLCERT=$PROJ_PATH/tmp
27-
- export TEST_SSL_CA_FILE=$SSLCERT/server.crt
28-
- export TEST_SSL_CLIENT_KEY_FILE=$SSLCERT/client.key
29-
- export TEST_SSL_CLIENT_CERT_FILE=$SSLCERT/client.crt
30-
- export TEST_SSL_CLIENT_KEYSTORE_FILE=$SSLCERT/client-keystore.p12
18+
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
19+
# generate SSL certificates
20+
- mkdir tmp
21+
- chmod +x .travis/gen-ssl.sh
22+
- chmod +x .travis/build/build.sh
23+
- chmod +x .travis/build/docker-entrypoint.sh
24+
- chmod 777 .travis/build/
25+
- .travis/gen-ssl.sh mariadb.example.com tmp
26+
- export PROJ_PATH=`pwd`
27+
- export SSLCERT=$PROJ_PATH/tmp
28+
- export TEST_SSL_CA_FILE=$SSLCERT/server.crt
29+
- export TEST_SSL_CLIENT_KEY_FILE=$SSLCERT/client.key
30+
- export TEST_SSL_CLIENT_CERT_FILE=$SSLCERT/client.crt
31+
- export TEST_SSL_CLIENT_KEYSTORE_FILE=$SSLCERT/client-keystore.p12
3132

3233
env:
3334
global:
@@ -80,7 +81,7 @@ notifications:
8081
script:
8182
- npm install
8283
- npm install nyc -g
83-
- .travis/script.sh
84+
- travis_retry .travis/script.sh
8485

8586
after_success:
8687
- if [ -z "$BENCH" ] ; then npm run coverage:report; fi

.travis/build/Dockerfile

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
FROM debian:jessie
1+
# vim:set ft=dockerfile:
2+
FROM ubuntu:bionic
23

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

7+
# https://bugs.debian.org/830696 (apt uses gpgv by default in newer releases, rather than gpg)
8+
RUN set -ex; \
9+
apt-get update; \
10+
if ! which gpg; then \
11+
apt-get install -y --no-install-recommends gnupg; \
12+
fi; \
13+
# Ubuntu includes "gnupg" (not "gnupg2", but still 2.x), but not dirmngr, and gnupg 2.x requires dirmngr
14+
# so, if we're not running gnupg 1.x, explicitly install dirmngr too
15+
if ! gpg --version | grep -q '^gpg (GnuPG) 1\.'; then \
16+
apt-get install -y --no-install-recommends dirmngr; \
17+
fi; \
18+
rm -rf /var/lib/apt/lists/*
19+
620
# add gosu for easy step-down from root
721
ENV GOSU_VERSION 1.10
822
RUN set -ex; \
@@ -21,8 +35,9 @@ RUN set -ex; \
2135
\
2236
# verify the signature
2337
export GNUPGHOME="$(mktemp -d)"; \
24-
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
38+
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
2539
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
40+
command -v gpgconf > /dev/null && gpgconf --kill all || :; \
2641
rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc; \
2742
\
2843
chmod +x /usr/local/bin/gosu; \
@@ -37,27 +52,29 @@ RUN mkdir /docker-entrypoint-initdb.d
3752
# install "apt-transport-https" for Percona's repo (switched to https-only)
3853
RUN apt-get update && apt-get install -y --no-install-recommends \
3954
apt-transport-https ca-certificates \
55+
tzdata \
4056
pwgen \
4157
&& rm -rf /var/lib/apt/lists/*
4258

4359
RUN { \
44-
echo "mariadb-server-10.3" mysql-server/root_password password 'unused'; \
45-
echo "mariadb-server-10.3" mysql-server/root_password_again password 'unused'; \
60+
echo "mariadb-server-10.4" mysql-server/root_password password 'unused'; \
61+
echo "mariadb-server-10.4" mysql-server/root_password_again password 'unused'; \
4662
} | debconf-set-selections
4763

4864
RUN apt-get update -y
4965
RUN apt-get install -y software-properties-common wget
5066
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
51-
RUN echo 'deb http://yum.mariadb.org/galera/repo/deb jessie main' > /etc/apt/sources.list.d/galera-test-repo.list
67+
RUN apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net F1656F24C74CD1D8
68+
RUN echo 'deb http://yum.mariadb.org/galera/repo/deb bionic main' > /etc/apt/sources.list.d/galera-test-repo.list
5269
RUN apt-get update -y
5370

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

5673
COPY *.deb /root/
5774
RUN chmod 777 /root/*
5875

59-
RUN dpkg -R --install /root/mysql-common*
60-
RUN dpkg -R --install /root/mariadb-common*
76+
RUN dpkg --install /root/mysql-common*
77+
RUN dpkg --install /root/mariadb-common*
6178
RUN dpkg -R --unpack /root/
6279
RUN apt-get install -f -y
6380

.travis/build/build.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ echo "**************************************************************************
44
echo "* searching for last complete build"
55
echo "**************************************************************************"
66

7-
wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.3/
7+
wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.4/
88
grep -o ">build-[0-9]*" index.html | grep -o "[0-9]*" | tac | while read -r line ; do
99

10-
curl -s --head http://hasky.askmonty.org/archive/10.3/build-$line/kvm-deb-jessie-amd64/md5sums.txt | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null
10+
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
1111
if [ $? = "0" ]; then
1212
echo "**************************************************************************"
1313
echo "* Processing $line"
1414
echo "**************************************************************************"
15-
wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.3/build-$line/kvm-deb-jessie-amd64/debs/binary/
15+
wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.4/build-$line/kvm-deb-bionic-amd64/debs/binary/
1616
grep -o ">[^\"]*\.deb" $line.html | grep -o "[^>]*\.deb" | while read -r file ; do
1717
if [[ "$file" =~ ^mariadb-plugin.* ]] ;
1818
then
1919
echo "skipped file: $file"
2020
else
2121
echo "download file: $file"
22-
wget -q -o /dev/null -O .travis/build/$file http://hasky.askmonty.org/archive/10.3/build-$line/kvm-deb-jessie-amd64/debs/binary/$file
22+
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
2323
fi
2424
done
2525

.travis/build/docker-entrypoint.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@ _check_config() {
4444
toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" )
4545
if ! errors="$("${toRun[@]}" 2>&1 >/dev/null)"; then
4646
cat >&2 <<-EOM
47-
4847
ERROR: mysqld failed while attempting to check config
4948
command was: "${toRun[*]}"
50-
5149
$errors
5250
EOM
5351
exit 1
@@ -59,15 +57,17 @@ _check_config() {
5957
# latter only show values present in config files, and not server defaults
6058
_get_config() {
6159
local conf="$1"; shift
62-
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null | awk '$1 == "'"$conf"'" { print $2; exit }'
60+
"$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \
61+
| awk '$1 == "'"$conf"'" && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }'
62+
# match "datadir /some/path with/spaces in/it here" but not "--xyz=abc\n datadir (xyz)"
6363
}
6464

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

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

9090
echo 'Initializing database'
91-
mysql_install_db --datadir="$DATADIR" --rpm
91+
installArgs=( --datadir="$DATADIR" --rpm )
92+
if { mysql_install_db --help || :; } | grep -q -- '--auth-root-authentication-method'; then
93+
# 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
94+
# see https://github.com/MariaDB/server/commit/b9f3f06857ac6f9105dc65caae19782f09b47fb3
95+
# (this flag doesn't exist in 10.0 and below)
96+
installArgs+=( --auth-root-authentication-method=normal )
97+
fi
98+
# "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here)
99+
mysql_install_db "${installArgs[@]}" "${@:2}"
92100
echo 'Database initialized'
93101

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

169174
echo

benchmarks/benchmarkOne.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
"use strict";
1+
'use strict';
22

3-
const fs = require("fs");
4-
const Bench = require("./common_benchmarks");
3+
const fs = require('fs');
4+
const Bench = require('./common_benchmarks');
55
let bench;
66

77
const launchBenchs = function(path) {
88
bench = new Bench();
99

10-
const test = "bench_promise_insert_batch.js";
11-
const m = require(path + "/" + test);
10+
const test = 'bench_promise_insert_batch.js';
11+
const m = require(path + '/' + test);
1212
bench.initFcts.push(m.initFct);
1313
bench.add(m.title, m.displaySql, m.benchFct, m.onComplete, m.promise, m.pool); //, bench.CONN.MYSQL);
1414

1515
bench.suiteReady();
1616
};
1717

18-
fs.access("./benchs", function(err) {
18+
fs.access('../benchs', function(err) {
1919
if (err) {
20-
fs.access("./benchmarks/benchs", function(err) {
21-
launchBenchs("./benchmarks/benchs");
20+
fs.access('../benchmarks/benchs', function(err) {
21+
launchBenchs('../benchmarks/benchs');
2222
});
2323
} else {
24-
launchBenchs("./benchs");
24+
launchBenchs('../benchs');
2525
}
2626
});

benchmarks/benchmarks.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
"use strict";
1+
'use strict';
22

3-
const fs = require("fs");
4-
const Bench = require("./common_benchmarks");
3+
const fs = require('fs');
4+
const Bench = require('./common_benchmarks');
55
const launchBenchs = function(path) {
66
fs.readdir(path, function(err, list) {
77
if (err) {
@@ -11,21 +11,28 @@ const launchBenchs = function(path) {
1111
const bench = new Bench();
1212
//launch all benchmarks
1313
for (let i = 0; i < list.length; i++) {
14-
console.log("benchmark: ./benchs/" + list[i]);
15-
const m = require("./benchs/" + list[i]);
14+
console.log('benchmark: ./benchs/' + list[i]);
15+
const m = require('./benchs/' + list[i]);
1616
bench.initFcts.push(m.initFct);
17-
bench.add(m.title, m.displaySql, m.benchFct, m.onComplete, m.promise, m.pool);
17+
bench.add(
18+
m.title,
19+
m.displaySql,
20+
m.benchFct,
21+
m.onComplete,
22+
m.promise,
23+
m.pool
24+
);
1825
}
1926
bench.suiteReady();
2027
});
2128
};
22-
fs.access("./benchs", function(err) {
29+
fs.access('./benchs', function(err) {
2330
if (err) {
24-
fs.access("./benchmarks/benchs", function(err) {
31+
fs.access('./benchmarks/benchs', function(err) {
2532
if (err) return;
26-
launchBenchs("./benchmarks/benchs");
33+
launchBenchs('./benchmarks/benchs');
2734
});
2835
} else {
29-
launchBenchs("./benchs");
36+
launchBenchs('./benchs');
3037
}
3138
});

benchmarks/benchs/bench_do.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
const assert = require("assert");
1+
const assert = require('assert');
22

3-
module.exports.title = "do ? using callback";
4-
module.exports.displaySql = "do ?";
3+
module.exports.title = 'do ? using callback';
4+
module.exports.displaySql = 'do ?';
55
module.exports.promise = false;
66
module.exports.benchFct = function(conn, deferred) {
7-
conn.query("do ?", ["" + Math.floor(Math.random() * 50000000)], (err, res) => {
8-
if (err) throw err;
9-
// let val = Array.isArray(rows) ? rows[0] : rows;
10-
// assert.equal(1, val.info ? val.info.affectedRows : val.affectedRows);
11-
deferred.resolve();
12-
});
7+
conn.query(
8+
'do ?',
9+
['' + Math.floor(Math.random() * 50000000)],
10+
(err, res) => {
11+
if (err) throw err;
12+
// let val = Array.isArray(rows) ? rows[0] : rows;
13+
// assert.equal(1, val.info ? val.info.affectedRows : val.affectedRows);
14+
deferred.resolve();
15+
}
16+
);
1317
};

benchmarks/benchs/bench_promise_do.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const assert = require("assert");
1+
const assert = require('assert');
22

3-
module.exports.title = "do ? using promise";
4-
module.exports.displaySql = "do ?";
3+
module.exports.title = 'do ? using promise';
4+
module.exports.displaySql = 'do ?';
55
module.exports.promise = true;
66
module.exports.benchFct = function(conn, deferred) {
77
conn
8-
.query("do ?", ["" + Math.floor(Math.random() * 50000000)])
8+
.query('do ?', ['' + Math.floor(Math.random() * 50000000)])
99
.then(rows => {
1010
// let val = Array.isArray(rows) ? rows[0] : rows;
1111
// assert.equal(1, val.info ? val.info.affectedRows : val.affectedRows);

0 commit comments

Comments
 (0)