From 7242d06a135392117d7a7413b5ad4de9775f749b Mon Sep 17 00:00:00 2001 From: Keyur Shah Date: Thu, 31 Dec 2020 00:56:18 +0530 Subject: [PATCH 01/13] Converting ALL Bigint Ref --- lib/cmd/handshake/client-capabilities.js | 2 +- .../handshake/client-handshake-response.js | 2 +- lib/cmd/handshake/initial-handshake.js | 6 +- lib/cmd/handshake/ssl-request.js | 2 +- lib/connection.js | 2 +- lib/const/capabilities.js | 56 +++++++++---------- lib/io/packet.js | 2 +- test/integration/datatype/test-integer.js | 20 +++---- 8 files changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/cmd/handshake/client-capabilities.js b/lib/cmd/handshake/client-capabilities.js index 41f8ed5d..ffc2f151 100644 --- a/lib/cmd/handshake/client-capabilities.js +++ b/lib/cmd/handshake/client-capabilities.js @@ -19,7 +19,7 @@ module.exports.init = function (opts, info) { Capabilities.SESSION_TRACK | Capabilities.PLUGIN_AUTH_LENENC_CLIENT_DATA; - if ((info.serverCapabilities & Capabilities.MYSQL) === 0n) { + if ((info.serverCapabilities & Capabilities.MYSQL) === BigInt(0)) { capabilities |= Capabilities.MARIADB_CLIENT_EXTENDED_TYPE_INFO; } diff --git a/lib/cmd/handshake/client-handshake-response.js b/lib/cmd/handshake/client-handshake-response.js index 652f1410..2b890982 100644 --- a/lib/cmd/handshake/client-handshake-response.js +++ b/lib/cmd/handshake/client-handshake-response.js @@ -46,7 +46,7 @@ module.exports.send = function send(cmd, out, opts, pluginName, info) { out.writeInt8(0); } - out.writeInt32(Number(info.clientCapabilities >> 32n)); + out.writeInt32(Number(info.clientCapabilities >> BigInt(32))); //null encoded user out.writeString(opts.user || ''); diff --git a/lib/cmd/handshake/initial-handshake.js b/lib/cmd/handshake/initial-handshake.js index f8edd0d9..b67a3c0b 100644 --- a/lib/cmd/handshake/initial-handshake.js +++ b/lib/cmd/handshake/initial-handshake.js @@ -22,7 +22,7 @@ class InitialHandshake { //skip characterSet packet.skip(1); info.status = packet.readUInt16(); - serverCapabilities += BigInt(packet.readUInt16()) << 16n; + serverCapabilities += BigInt(packet.readUInt16()) << BigInt(16); let saltLength = 0; if (serverCapabilities & Capabilities.PLUGIN_AUTH) { @@ -34,7 +34,7 @@ class InitialHandshake { packet.skip(10); } else { packet.skip(6); - serverCapabilities += BigInt(packet.readUInt32()) << 32n; + serverCapabilities += BigInt(packet.readUInt32()) << BigInt(32); } if (serverCapabilities & Capabilities.SECURE_CONNECTION) { @@ -59,7 +59,7 @@ class InitialHandshake { //Support for MDEV-7780 faking server version info.serverVersion.mariaDb = info.serverVersion.raw.includes('MariaDB') || - (serverCapabilities & Capabilities.MYSQL) === 0n; + (serverCapabilities & Capabilities.MYSQL) === BigInt(0); } if (serverCapabilities & Capabilities.PLUGIN_AUTH) { diff --git a/lib/cmd/handshake/ssl-request.js b/lib/cmd/handshake/ssl-request.js index c6467d58..50d8cc53 100644 --- a/lib/cmd/handshake/ssl-request.js +++ b/lib/cmd/handshake/ssl-request.js @@ -22,7 +22,7 @@ module.exports.send = function sendSSLRequest(cmd, out, info, opts) { if (info.serverCapabilities & Capabilities.MYSQL) { out.writeInt32(0); } else { - out.writeInt32(Number(info.clientCapabilities >> 32n)); + out.writeInt32(Number(info.clientCapabilities >> BigInt(32))); } out.flushBuffer(true); diff --git a/lib/connection.js b/lib/connection.js index eef771e5..eb118830 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -666,7 +666,7 @@ function Connection(options) { info.serverVersion.mariaDb && info.hasMinVersion(10, 2, 7) && opts.bulk && - (info.serverCapabilities & Capabilities.MARIADB_CLIENT_STMT_BULK_OPERATIONS) > 0n; + (info.serverCapabilities & Capabilities.MARIADB_CLIENT_STMT_BULK_OPERATIONS) > BigInt(0); if (useBulk) { //ensure that there is no stream object diff --git a/lib/const/capabilities.js b/lib/const/capabilities.js index aedd8568..6ad5b4c7 100644 --- a/lib/const/capabilities.js +++ b/lib/const/capabilities.js @@ -3,62 +3,62 @@ * see : https://mariadb.com/kb/en/library/1-connecting-connecting/#capabilities */ /* mysql/old mariadb server/client */ -module.exports.MYSQL = 1n; +module.exports.MYSQL = BigInt(1); /* Found instead of affected rows */ -module.exports.FOUND_ROWS = 2n; +module.exports.FOUND_ROWS = BigInt(2); /* get all column flags */ -module.exports.LONG_FLAG = 4n; +module.exports.LONG_FLAG = BigInt(4); /* one can specify db on connect */ -module.exports.CONNECT_WITH_DB = 8n; +module.exports.CONNECT_WITH_DB = BigInt(8); /* don't allow database.table.column */ -module.exports.NO_SCHEMA = 1n << 4n; +module.exports.NO_SCHEMA = BigInt(1) << BigInt(4); /* can use compression protocol */ -module.exports.COMPRESS = 1n << 5n; +module.exports.COMPRESS = BigInt(1) << BigInt(5); /* odbc client */ -module.exports.ODBC = 1n << 6n; +module.exports.ODBC = BigInt(1) << BigInt(6); /* can use LOAD DATA LOCAL */ -module.exports.LOCAL_FILES = 1n << 7n; +module.exports.LOCAL_FILES = BigInt(1) << BigInt(7); /* ignore spaces before '' */ -module.exports.IGNORE_SPACE = 1n << 8n; +module.exports.IGNORE_SPACE = BigInt(1) << BigInt(8); /* new 4.1 protocol */ -module.exports.PROTOCOL_41 = 1n << 9n; +module.exports.PROTOCOL_41 = BigInt(1) << BigInt(9); /* this is an interactive client */ -module.exports.INTERACTIVE = 1n << 10n; +module.exports.INTERACTIVE = BigInt(1) << BigInt(10); /* switch to ssl after handshake */ -module.exports.SSL = 1n << 11n; +module.exports.SSL = BigInt(1) << BigInt(11); /* IGNORE sigpipes */ -module.exports.IGNORE_SIGPIPE = 1n << 12n; +module.exports.IGNORE_SIGPIPE = BigInt(1) << BigInt(12); /* client knows about transactions */ -module.exports.TRANSACTIONS = 1n << 13n; +module.exports.TRANSACTIONS = BigInt(1) << BigInt(13); /* old flag for 4.1 protocol */ -module.exports.RESERVED = 1n << 14n; +module.exports.RESERVED = BigInt(1) << BigInt(14); /* new 4.1 authentication */ -module.exports.SECURE_CONNECTION = 1n << 15n; +module.exports.SECURE_CONNECTION = BigInt(1) << BigInt(15); /* enable/disable multi-stmt support */ -module.exports.MULTI_STATEMENTS = 1n << 16n; +module.exports.MULTI_STATEMENTS = BigInt(1) << BigInt(16); /* enable/disable multi-results */ -module.exports.MULTI_RESULTS = 1n << 17n; +module.exports.MULTI_RESULTS = BigInt(1) << BigInt(17); /* multi-results in ps-protocol */ -module.exports.PS_MULTI_RESULTS = 1n << 18n; +module.exports.PS_MULTI_RESULTS = BigInt(1) << BigInt(18); /* client supports plugin authentication */ -module.exports.PLUGIN_AUTH = 1n << 19n; +module.exports.PLUGIN_AUTH = BigInt(1) << BigInt(19); /* permits connection attributes */ -module.exports.CONNECT_ATTRS = 1n << 20n; +module.exports.CONNECT_ATTRS = BigInt(1) << BigInt(20); /* Enable authentication response packet to be larger than 255 bytes. */ -module.exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = 1n << 21n; +module.exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = BigInt(1) << BigInt(21); /* Don't close the connection for a connection with expired password. */ -module.exports.CAN_HANDLE_EXPIRED_PASSWORDS = 1n << 22n; +module.exports.CAN_HANDLE_EXPIRED_PASSWORDS = BigInt(1) << BigInt(22); /* Capable of handling server state change information. Its a hint to the server to include the state change information in Ok packet. */ -module.exports.SESSION_TRACK = 1n << 23n; +module.exports.SESSION_TRACK = BigInt(1) << BigInt(23); /* Client no longer needs EOF packet */ -module.exports.DEPRECATE_EOF = 1n << 24n; -module.exports.SSL_VERIFY_SERVER_CERT = 1n << 30n; +module.exports.DEPRECATE_EOF = BigInt(1) << BigInt(24); +module.exports.SSL_VERIFY_SERVER_CERT = BigInt(1) << BigInt(30); /* MariaDB extended capabilities */ /* Permit bulk insert*/ -module.exports.MARIADB_CLIENT_STMT_BULK_OPERATIONS = 1n << 34n; +module.exports.MARIADB_CLIENT_STMT_BULK_OPERATIONS = BigInt(1) << BigInt(34); /* Clients supporting extended metadata */ -module.exports.MARIADB_CLIENT_EXTENDED_TYPE_INFO = 1n << 35n; +module.exports.MARIADB_CLIENT_EXTENDED_TYPE_INFO = BigInt(1) << BigInt(35); diff --git a/lib/io/packet.js b/lib/io/packet.js index d6ad9548..493cc571 100644 --- a/lib/io/packet.js +++ b/lib/io/packet.js @@ -191,7 +191,7 @@ class Packet { this.buf[this.pos + 6] * 2 ** 16 + (this.buf[this.pos + 7] << 24); const vv = - (BigInt(val) << 32n) + + (BigInt(val) << BigInt(32)) + BigInt( this.buf[this.pos] + this.buf[this.pos + 1] * 2 ** 8 + diff --git a/test/integration/datatype/test-integer.js b/test/integration/datatype/test-integer.js index 432e9fb2..d99c255a 100644 --- a/test/integration/datatype/test-integer.js +++ b/test/integration/datatype/test-integer.js @@ -121,12 +121,12 @@ describe('integer with big value', () => { }) .then((rows) => { assert.strictEqual(rows.length, 6); - assert.strictEqual(rows[0].v, -9007199254740991n); - assert.strictEqual(rows[1].v, 127n); - assert.strictEqual(rows[2].v, 128n); - assert.strictEqual(rows[3].v, 9007199254740991n); - assert.strictEqual(rows[4].v, 9007199254740992n); - assert.strictEqual(rows[5].v, 9007199254740993n); + assert.strictEqual(rows[0].v, BigInt(-9007199254740991)); + assert.strictEqual(rows[1].v, BigInt(127)); + assert.strictEqual(rows[2].v, BigInt(128)); + assert.strictEqual(rows[3].v, BigInt(9007199254740991)); + assert.strictEqual(rows[4].v, BigInt(9007199254740992)); + assert.strictEqual(rows[5].v, BigInt(9007199254740993)); assert.strictEqual(typeof rows[4].v, 'bigint'); return base.createConnection({ supportBigInt: true }); }) @@ -134,7 +134,7 @@ describe('integer with big value', () => { conn2 .query('INSERT INTO testBigint values ()') .then((rows) => { - assert.strictEqual(rows.insertId, 9007199254740994n); + assert.strictEqual(rows.insertId, BigInt(9007199254740994)); conn2.end(); done(); }) @@ -175,7 +175,7 @@ describe('integer with big value', () => { }) .then((rows) => { assert.strictEqual(rows.length, 2); - assert.strictEqual(rows[0].v, 127n); + assert.strictEqual(rows[0].v, BigInt(127)); assert.strictEqual(rows[1].v, null); done(); }); @@ -252,7 +252,7 @@ describe('integer with big value', () => { }); it('using very big number bigint', function (done) { - const maxValue = 18446744073709551615n; + const maxValue = BigInt(18446744073709551615); base.createConnection({ supportBigInt: true }).then((conn) => { conn .query('DROP TABLE IF EXISTS BIG_NUMBER') @@ -266,7 +266,7 @@ describe('integer with big value', () => { return conn.query('SELECT * FROM BIG_NUMBER LIMIT ?', [maxValue]); }) .then((res) => { - assert.deepEqual(res, [{ val: 10n }, { val: maxValue }]); + assert.deepEqual(res, [{ val: BigInt(10) }, { val: maxValue }]); conn.end(); done(); }) From 0c7129b6fc091ae4d775c8c3da18c4a30469814d Mon Sep 17 00:00:00 2001 From: Keyur Shah Date: Thu, 31 Dec 2020 01:21:53 +0530 Subject: [PATCH 02/13] More Ref Removed --- lib/cmd/handshake/client-handshake-response.js | 2 +- lib/cmd/handshake/ssl-request.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cmd/handshake/client-handshake-response.js b/lib/cmd/handshake/client-handshake-response.js index 2b890982..2305d242 100644 --- a/lib/cmd/handshake/client-handshake-response.js +++ b/lib/cmd/handshake/client-handshake-response.js @@ -39,7 +39,7 @@ module.exports.send = function send(cmd, out, opts, pluginName, info) { authPlugin = 'mysql_native_password'; break; } - out.writeInt32(Number(info.clientCapabilities & 0xffffffffn)); + out.writeInt32(Number(info.clientCapabilities & BigInt(0xffffffff))); out.writeInt32(1024 * 1024 * 1024); // max packet size out.writeInt8(opts.collation.index); for (let i = 0; i < 19; i++) { diff --git a/lib/cmd/handshake/ssl-request.js b/lib/cmd/handshake/ssl-request.js index 50d8cc53..03cfeb60 100644 --- a/lib/cmd/handshake/ssl-request.js +++ b/lib/cmd/handshake/ssl-request.js @@ -12,7 +12,7 @@ const Capabilities = require('../../const/capabilities'); */ module.exports.send = function sendSSLRequest(cmd, out, info, opts) { out.startPacket(cmd); - out.writeInt32(Number(info.clientCapabilities & 0xffffffffn)); + out.writeInt32(Number(info.clientCapabilities & BigInt(0xffffffff))); out.writeInt32(1024 * 1024 * 1024); // max packet size out.writeInt8(opts.collation.index); for (let i = 0; i < 19; i++) { From a218839a1756ba67e4529de2bb489dfe5a9dead5 Mon Sep 17 00:00:00 2001 From: kolzeq Date: Fri, 8 Jan 2021 14:00:00 +0100 Subject: [PATCH 03/13] [CONJS-157] Batch error when setting maxAllowedPacket less than an insert parameter value --- lib/io/bulk-packet.js | 2 +- test/integration/test-streaming.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/io/bulk-packet.js b/lib/io/bulk-packet.js index 8a42c27e..531a9e7e 100644 --- a/lib/io/bulk-packet.js +++ b/lib/io/bulk-packet.js @@ -550,6 +550,7 @@ class BulkPacket { } this.pos = 4; + this.markPos = undefined; if (this.nextRow) this.writeHeader(this.nextRow); if (afterMark) { if (this.buf.length - this.pos < afterMark.length) @@ -557,7 +558,6 @@ class BulkPacket { afterMark.copy(this.buf, this.pos, 0, afterMark.length); this.pos += afterMark.length; } - this.markPos = undefined; this.singleQuery = false; this.singleQuerySequenceNo = undefined; this.singleQueryCompressSequenceNo = undefined; diff --git a/test/integration/test-streaming.js b/test/integration/test-streaming.js index 66173b1d..7de68b2d 100644 --- a/test/integration/test-streaming.js +++ b/test/integration/test-streaming.js @@ -67,7 +67,7 @@ describe('streaming', () => { }); it('Streaming single parameter', async function () { - if (maxAllowedSize < size) this.skip(); + if (maxAllowedSize <= size) this.skip(); this.timeout(20000); const r = fs.createReadStream(fileName); await shareConn.query('truncate Streaming'); @@ -80,7 +80,7 @@ describe('streaming', () => { it('Streaming multiple parameter', async function () { this.timeout(20000); - if (maxAllowedSize < size) this.skip(); + if (maxAllowedSize <= size) this.skip(); const r = fs.createReadStream(halfFileName); const r2 = fs.createReadStream(halfFileName); await shareConn.query('truncate Streaming'); @@ -98,7 +98,7 @@ describe('streaming', () => { }); it('Streaming multiple parameter begin no stream', async function () { - if (maxAllowedSize < size) this.skip(); + if (maxAllowedSize <= size) this.skip(); this.timeout(20000); const r = fs.createReadStream(halfFileName); const r2 = fs.createReadStream(halfFileName); @@ -117,7 +117,7 @@ describe('streaming', () => { }); it('Streaming multiple parameter ensure max callstack', async function () { - if (maxAllowedSize < size) this.skip(); + if (maxAllowedSize <= size) this.skip(); this.timeout(20000); const r = fs.createReadStream(halfFileName); From 2fc839b58ebbf1627b54214ba67d235ae91c768c Mon Sep 17 00:00:00 2001 From: Keyur Shah Date: Fri, 15 Jan 2021 00:53:22 +0530 Subject: [PATCH 04/13] Some BigInt Ref replace with String As per Conversation --- test/integration/datatype/test-integer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/integration/datatype/test-integer.js b/test/integration/datatype/test-integer.js index d99c255a..ddabc96c 100644 --- a/test/integration/datatype/test-integer.js +++ b/test/integration/datatype/test-integer.js @@ -125,8 +125,8 @@ describe('integer with big value', () => { assert.strictEqual(rows[1].v, BigInt(127)); assert.strictEqual(rows[2].v, BigInt(128)); assert.strictEqual(rows[3].v, BigInt(9007199254740991)); - assert.strictEqual(rows[4].v, BigInt(9007199254740992)); - assert.strictEqual(rows[5].v, BigInt(9007199254740993)); + assert.strictEqual(rows[4].v, BigInt('9007199254740992')); + assert.strictEqual(rows[5].v, BigInt('9007199254740993')); assert.strictEqual(typeof rows[4].v, 'bigint'); return base.createConnection({ supportBigInt: true }); }) @@ -134,7 +134,7 @@ describe('integer with big value', () => { conn2 .query('INSERT INTO testBigint values ()') .then((rows) => { - assert.strictEqual(rows.insertId, BigInt(9007199254740994)); + assert.strictEqual(rows.insertId, BigInt('9007199254740994')); conn2.end(); done(); }) @@ -252,7 +252,7 @@ describe('integer with big value', () => { }); it('using very big number bigint', function (done) { - const maxValue = BigInt(18446744073709551615); + const maxValue = BigInt('18446744073709551615'); base.createConnection({ supportBigInt: true }).then((conn) => { conn .query('DROP TABLE IF EXISTS BIG_NUMBER') From 6b88c38eb1a0bee3b090f54dcbec10ba42c6a92d Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 18 Jan 2021 12:23:44 +0100 Subject: [PATCH 05/13] [misc] removing unnecessary failing retry --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9d4e6029..c8a316e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ before_install: - chmod +x .travis/script.sh install: - - wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash # generate SSL certificates - mkdir tmp - chmod +x .travis/gen-ssl.sh From 80070b93496c3d5e297d8ae3cdd1b74478edde5a Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 18 Jan 2021 12:39:29 +0100 Subject: [PATCH 06/13] [CONJS-159] test 10.6 server latest build --- .travis.yml | 6 +- .travis/build/Dockerfile | 24 +- .travis/build/build.sh | 10 +- .travis/build/docker-entrypoint.sh | 435 ++++++++++++++++++++--------- .travis/script.sh | 4 +- 5 files changed, 321 insertions(+), 158 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8a316e9..2da6c8e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,10 +40,10 @@ env: matrix: allow_failures: - node_js: "12" - env: DB=build SKIP_LEAK=1 + env: DB=build:10.6 SKIP_LEAK=1 include: - node_js: "12" - env: DB=build SKIP_LEAK=1 + env: DB=build:10.6 SKIP_LEAK=1 - node_js: "12" env: SKYSQL=true SKIP_LEAK=1 - node_js: "12" @@ -83,7 +83,7 @@ notifications: script: - npm install - npm install nyc -g -- travis_retry .travis/script.sh +- .travis/script.sh after_success: - if [ -z "$BENCH" ] ; then npm run coverage:report; fi \ No newline at end of file diff --git a/.travis/build/Dockerfile b/.travis/build/Dockerfile index 53bfc85d..73042544 100644 --- a/.travis/build/Dockerfile +++ b/.travis/build/Dockerfile @@ -1,5 +1,5 @@ # vim:set ft=dockerfile: -FROM ubuntu:bionic +FROM ubuntu:xenial # 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 @@ -57,18 +57,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* RUN { \ - echo "mariadb-server-10.5" mysql-server/root_password password 'unused'; \ - echo "mariadb-server-10.5" mysql-server/root_password_again password 'unused'; \ + echo "mariadb-server-10.6" mysql-server/root_password password 'unused'; \ + echo "mariadb-server-10.6" mysql-server/root_password_again password 'unused'; \ } | debconf-set-selections 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 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-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db +#RUN apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net F1656F24C74CD1D8 +#RUN echo 'deb http://yum.mariadb.org/galera/repo/deb xenial 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 libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 -RUN apt-get install -y curl libdbi-perl rsync socat galera3 libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 +#RUN apt-get install -y galera3 COPY *.deb /root/ RUN chmod 777 /root/* @@ -77,15 +79,17 @@ RUN dpkg --install /root/mysql-common* RUN dpkg --install /root/mariadb-common* RUN dpkg -R --unpack /root/ RUN apt-get install -f -y - +RUN ls -lrt /etc/mysql +RUN ls -lrt /etc/mysql/mariadb.conf.d RUN rm -rf /var/lib/apt/lists/* \ + && sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/mariadb.conf.d/*.cnf \ && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ && chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ && chmod 777 /var/run/mysqld \ && find /etc/mysql/ -name '*.cnf' -print0 \ | xargs -0 grep -lZE '^(bind-address|log)' \ | xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \ - && echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/conf.d/docker.cnf + && echo '[mysqld]\nskip-host-cache\nskip-name-resolve' > /etc/mysql/mariadb.conf.d/docker.cnf VOLUME /var/lib/mysql diff --git a/.travis/build/build.sh b/.travis/build/build.sh index f4d4c85d..cd62d279 100644 --- a/.travis/build/build.sh +++ b/.travis/build/build.sh @@ -4,22 +4,22 @@ echo "************************************************************************** echo "* searching for last complete build" echo "**************************************************************************" -wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.5/ +wget -q -o /dev/null index.html http://hasky.askmonty.org/archive/10.6/ 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.5/build-$line/kvm-deb-bionic-amd64/md5sums.txt | head -n 1 | grep "HTTP/1.[01] [23].." > /dev/null + curl -s --head http://hasky.askmonty.org/archive/10.6/build-$line/kvm-deb-xenial-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.5/build-$line/kvm-deb-bionic-amd64/debs/binary/ + wget -q -o /dev/null -O $line.html http://hasky.askmonty.org/archive/10.6/build-$line/kvm-deb-xenial-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.5/build-$line/kvm-deb-bionic-amd64/debs/binary/$file + echo "download file: http://hasky.askmonty.org/archive/10.6/build-$line/kvm-deb-xenial-amd64/debs/binary/$file" + wget -q -o /dev/null -O .travis/build/$file http://hasky.askmonty.org/archive/10.6/build-$line/kvm-deb-xenial-amd64/debs/binary/$file fi done diff --git a/.travis/build/docker-entrypoint.sh b/.travis/build/docker-entrypoint.sh index a3ee049c..588f4788 100644 --- a/.travis/build/docker-entrypoint.sh +++ b/.travis/build/docker-entrypoint.sh @@ -2,21 +2,21 @@ set -eo pipefail shopt -s nullglob -# if command starts with an option, prepend mysqld -if [ "${1:0:1}" = '-' ]; then - set -- mysqld "$@" -fi - -# skip setup if they want an option that stops mysqld -wantHelp= -for arg; do - case "$arg" in - -'?'|--help|--print-defaults|-V|--version) - wantHelp=1 - break - ;; - esac -done +# logging functions +mysql_log() { + local type="$1"; shift + printf '%s [%s] [Entrypoint]: %s\n' "$(date --rfc-3339=seconds)" "$type" "$*" +} +mysql_note() { + mysql_log Note "$@" +} +mysql_warn() { + mysql_log Warn "$@" >&2 +} +mysql_error() { + mysql_log ERROR "$@" >&2 + exit 1 +} # usage: file_env VAR [DEFAULT] # ie: file_env 'XYZ_DB_PASSWORD' 'example' @@ -27,8 +27,7 @@ file_env() { local fileVar="${var}_FILE" local def="${2:-}" if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then - echo >&2 "error: both $var and $fileVar are set (but are exclusive)" - exit 1 + mysql_error "Both $var and $fileVar are set (but are exclusive)" fi local val="$def" if [ "${!var:-}" ]; then @@ -40,157 +39,317 @@ file_env() { unset "$fileVar" } -_check_config() { - toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) +# check to see if this file is being run or sourced from another script +_is_sourced() { + # https://unix.stackexchange.com/a/215279 + [ "${#FUNCNAME[@]}" -ge 2 ] \ + && [ "${FUNCNAME[0]}" = '_is_sourced' ] \ + && [ "${FUNCNAME[1]}" = 'source' ] +} + +# usage: docker_process_init_files [file [file [...]]] +# ie: docker_process_init_files /always-initdb.d/* +# process initializer files, based on file extensions +docker_process_init_files() { + # mysql here for backwards compatibility "${mysql[@]}" + mysql=( docker_process_sql ) + + echo + local f + for f; do + case "$f" in + *.sh) + # https://github.com/docker-library/postgres/issues/450#issuecomment-393167936 + # https://github.com/docker-library/postgres/pull/452 + if [ -x "$f" ]; then + mysql_note "$0: running $f" + "$f" + else + mysql_note "$0: sourcing $f" + . "$f" + fi + ;; + *.sql) mysql_note "$0: running $f"; docker_process_sql < "$f"; echo ;; + *.sql.gz) mysql_note "$0: running $f"; gunzip -c "$f" | docker_process_sql; echo ;; + *.sql.xz) mysql_note "$0: running $f"; xzcat "$f" | docker_process_sql; echo ;; + *) mysql_warn "$0: ignoring $f" ;; + esac + echo + done +} + +mysql_check_config() { + local toRun=( "$@" --verbose --help --log-bin-index="$(mktemp -u)" ) errors 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 + mysql_error $'mysqld failed while attempting to check config\n\tcommand was: '"${toRun[*]}"$'\n\t'"$errors" fi } # Fetch value from server config # We use mysqld --verbose --help instead of my_print_defaults because the # latter only show values present in config files, and not server defaults -_get_config() { +mysql_get_config() { local conf="$1"; shift "$@" --verbose --help --log-bin-index="$(mktemp -u)" 2>/dev/null \ - | awk '$1 == "'"$conf"'" && /^[^ \t]/ { sub(/^[^ \t]+[ \t]+/, ""); print; exit }' + | awk -v conf="$conf" '$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' "$@")" +# Do a temporary startup of the MySQL server, for init purposes +docker_temp_server_start() { + "$@" --skip-networking --socket="${SOCKET}" & + mysql_note "Waiting for server startup" + local i + for i in {30..0}; do + # only use the root password if the database has already been initializaed + # so that it won't try to fill in a password file when it hasn't been set yet + extraArgs=() + if [ -z "$DATABASE_ALREADY_EXISTS" ]; then + extraArgs+=( '--dont-use-mysql-root-password' ) + fi + if docker_process_sql "${extraArgs[@]}" --database=mysql <<<'SELECT 1' &> /dev/null; then + break + fi + sleep 1 + done + if [ "$i" = 0 ]; then + mysql_error "Unable to start server." + fi +} + +# Stop the server. When using a local socket file mysqladmin will block until +# the shutdown is complete. +docker_temp_server_stop() { + if ! mysqladmin --defaults-extra-file=<( _mysql_passfile ) shutdown -uroot --socket="${SOCKET}"; then + mysql_error "Unable to shut down server." + fi +} + +# Verify that the minimally required password settings are set for new databases. +docker_verify_minimum_env() { + if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then + mysql_error $'Database is uninitialized and password option is not specified\n\tYou need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' + fi +} + +# creates folders for the database +# also ensures permission for user mysql of run as root +docker_create_db_directories() { + local user; user="$(id -u)" + + # TODO other directories that are used by default? like /var/lib/mysql-files + # see https://github.com/docker-library/mysql/issues/562 mkdir -p "$DATADIR" - find "$DATADIR" \! -user mysql -exec chown mysql '{}' + - exec gosu mysql "$BASH_SOURCE" "$@" -fi -if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then - # still need to check config, container may have started with --user - _check_config "$@" + if [ "$user" = "0" ]; then + # this will cause less disk access than `chown -R` + find "$DATADIR" \! -user mysql -exec chown mysql '{}' + + fi +} + +# initializes the database directory +docker_init_database_dir() { + mysql_note "Initializing database files" + installArgs=( --datadir="$DATADIR" --rpm --auth-root-authentication-method=normal ) + if { mysql_install_db --help || :; } | grep -q -- '--skip-test-db'; then + # 10.3+ + installArgs+=( --skip-test-db ) + fi + # "Other options are passed to mysqld." (so we pass all "mysqld" arguments directly here) + mysql_install_db "${installArgs[@]}" "${@:2}" + mysql_note "Database files initialized" +} + +# Loads various settings that are used elsewhere in the script +# This should be called after mysql_check_config, but before any other functions +docker_setup_env() { # Get config - DATADIR="$(_get_config 'datadir' "$@")" - - if [ ! -d "$DATADIR/mysql" ]; then - file_env 'MYSQL_ROOT_PASSWORD' - if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then - echo >&2 'error: database is uninitialized and password option is not specified ' - echo >&2 ' You need to specify one of MYSQL_ROOT_PASSWORD, MYSQL_ALLOW_EMPTY_PASSWORD and MYSQL_RANDOM_ROOT_PASSWORD' - exit 1 - fi + declare -g DATADIR SOCKET + DATADIR="$(mysql_get_config 'datadir' "$@")" + SOCKET="$(mysql_get_config 'socket' "$@")" - mkdir -p "$DATADIR" + # Initialize values that might be stored in a file + file_env 'MYSQL_ROOT_HOST' '%' + file_env 'MYSQL_DATABASE' + file_env 'MYSQL_USER' + file_env 'MYSQL_PASSWORD' + file_env 'MYSQL_ROOT_PASSWORD' - echo 'Initializing database' - 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-corporation/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' "$@")" - "$@" --skip-networking --socket="${SOCKET}" & - pid="$!" - - mysql=( mysql --protocol=socket -uroot -hlocalhost --socket="${SOCKET}" ) - - for i in {30..0}; do - if echo 'SELECT 1' | "${mysql[@]}" &> /dev/null; then - break - fi - echo 'MySQL init process in progress...' - sleep 1 - done - if [ "$i" = 0 ]; then - echo >&2 'MySQL init process failed.' - exit 1 - fi + declare -g DATABASE_ALREADY_EXISTS + if [ -d "$DATADIR/mysql" ]; then + DATABASE_ALREADY_EXISTS='true' + fi +} - if [ -z "$MYSQL_INITDB_SKIP_TZINFO" ]; then - # sed is for https://bugs.mysql.com/bug.php?id=20545 - mysql_tzinfo_to_sql /usr/share/zoneinfo | sed 's/Local time zone must be set--see zic manual page/FCTY/' | "${mysql[@]}" mysql - fi +# Execute sql script, passed via stdin +# usage: docker_process_sql [--dont-use-mysql-root-password] [mysql-cli-args] +# ie: docker_process_sql --database=mydb <<<'INSERT ...' +# ie: docker_process_sql --dont-use-mysql-root-password --database=mydb &2 'MySQL init process failed.' - exit 1 + # skip setup if they aren't running mysqld or want an option that stops mysqld + if [ "$1" = 'mysqld' ] && ! _mysql_want_help "$@"; then + mysql_note "Entrypoint script for MySQL Server ${MARIADB_VERSION} started." + + mysql_check_config "$@" + # Load various environment variables + docker_setup_env "$@" + docker_create_db_directories + + # If container is started as root user, restart as dedicated mysql user + if [ "$(id -u)" = "0" ]; then + mysql_note "Switching to dedicated user 'mysql'" + exec gosu mysql "$BASH_SOURCE" "$@" fi - echo - echo 'MySQL init process done. Ready for start up.' - echo + # there's no database, so it needs to be initialized + if [ -z "$DATABASE_ALREADY_EXISTS" ]; then + docker_verify_minimum_env + + # check dir permissions to reduce likelihood of half-initialized database + ls /docker-entrypoint-initdb.d/ > /dev/null + + docker_init_database_dir "$@" + + mysql_note "Starting temporary server" + docker_temp_server_start "$@" + mysql_note "Temporary server started." + + docker_setup_db + docker_process_init_files /docker-entrypoint-initdb.d/* + + mysql_note "Stopping temporary server" + docker_temp_server_stop + mysql_note "Temporary server stopped" + + echo + mysql_note "MySQL init process done. Ready for start up." + echo + fi fi -fi + exec "$@" +} -exec "$@" \ No newline at end of file +# If we are sourced from elsewhere, don't perform any further actions +if ! _is_sourced; then + _main "$@" +fi \ No newline at end of file diff --git a/.travis/script.sh b/.travis/script.sh index ca8e5276..746da622 100644 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -37,9 +37,9 @@ else export COMPOSE_FILE=.travis/docker-compose.yml export ENTRYPOINT=$PROJ_PATH/.travis/sql - if [ "$DB" = "build" ] ; then + if [[ "$DB" == build* ]] ; then .travis/build/build.sh - docker build -t build:latest --label build .travis/build/ + docker build -t build:10.6 --label build .travis/build/ fi if [ -n "$MAXSCALE_VERSION" ] ; then From 9d88176f877e779fc08d49cdfbf9317228d9cb9c Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 1 Feb 2021 10:28:29 +0100 Subject: [PATCH 07/13] [CONJS-160] Wrong definition for typescript PoolConnection.release #145 --- types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/index.d.ts b/types/index.d.ts index ca366bcd..3460da02 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -582,7 +582,7 @@ export interface PoolConnection extends Connection { /** * Release the connection to pool internal cache. */ - release(): void; + release(): Promise; } export interface Pool { From a520193755ab859096cdf5d902ff02cf1155058a Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 1 Feb 2021 10:57:46 +0100 Subject: [PATCH 08/13] [misc] ensure proper test stability on unix if database not local --- .travis.yml | 1 - appveyor.yml | 1 - test/integration/datatype/test-datetime.js | 2 ++ test/integration/test-auth-plugin.js | 2 +- test/integration/test-socket.js | 6 +++--- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2da6c8e9..c7b8d1e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,6 @@ env: global: - TEST_PORT=3305 - TEST_HOST=mariadb.example.com - - MUST_USE_TCPIP=1 - RUN_LONG_TEST=1 matrix: diff --git a/appveyor.yml b/appveyor.yml index 874a27c0..4584bd7f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,6 @@ environment: LINT: 0 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 CMAKE_PARAM: 'Visual Studio 15 2017 Win64' - MUST_USE_TCPIP: 1 TEST_HOST: mariadb.example.com TEST_LOG_PACKETS: true matrix: diff --git a/test/integration/datatype/test-datetime.js b/test/integration/datatype/test-datetime.js index 0ed2a39d..cc74b20c 100644 --- a/test/integration/datatype/test-datetime.js +++ b/test/integration/datatype/test-datetime.js @@ -57,6 +57,8 @@ describe('datetime', () => { it('standard date', function (done) { //using distant server, time might be different + // if local socket not available, this means using distant / docker server that might have other default + if (!process.env.LOCAL_SOCKET_AVAILABLE) this.skip(); if ( (Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') || process.env.MAXSCALE_TEST_DISABLE diff --git a/test/integration/test-auth-plugin.js b/test/integration/test-auth-plugin.js index 07097c11..3b5c324c 100644 --- a/test/integration/test-auth-plugin.js +++ b/test/integration/test-auth-plugin.js @@ -180,7 +180,7 @@ describe('authentication plugin', () => { it('unix socket authentication plugin', function (done) { if (process.platform === 'win32') this.skip(); if (!shareConn.info.isMariaDB() || !shareConn.info.hasMinVersion(10, 1, 11)) this.skip(); - if (process.env.MUST_USE_TCPIP) this.skip(); + if (!process.env.LOCAL_SOCKET_AVAILABLE) this.skip(); if (Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') this.skip(); diff --git a/test/integration/test-socket.js b/test/integration/test-socket.js index 94fa257d..8754d65d 100644 --- a/test/integration/test-socket.js +++ b/test/integration/test-socket.js @@ -7,7 +7,7 @@ const Conf = require('../conf'); describe('test socket', () => { it('named pipe', function (done) { if (process.platform !== 'win32') this.skip(); - if (process.env.MUST_USE_TCPIP || process.env.MAXSCALE_TEST_DISABLE) this.skip(); + if (!process.env.LOCAL_SOCKET_AVAILABLE || process.env.MAXSCALE_TEST_DISABLE) this.skip(); if (Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') this.skip(); const test = this; @@ -49,7 +49,7 @@ describe('test socket', () => { it('named pipe error', function (done) { if (process.platform !== 'win32') this.skip(); - if (process.env.MUST_USE_TCPIP) this.skip(); + if (!process.env.LOCAL_SOCKET_AVAILABLE) this.skip(); if (Conf.baseConfig.host !== 'localhost' && Conf.baseConfig.host !== 'mariadb.example.com') this.skip(); @@ -70,7 +70,7 @@ describe('test socket', () => { }); it('unix socket', function (done) { - if (process.env.MUST_USE_TCPIP) this.skip(); + if (!process.env.LOCAL_SOCKET_AVAILABLE) this.skip(); if (process.platform === 'win32') this.skip(); if ( Conf.baseConfig.host && From 83eddb78bed0ac5ae060d6c7955eb345c138676e Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 1 Feb 2021 18:54:47 +0100 Subject: [PATCH 09/13] [misc] removing server eol version from test --- .travis.yml | 2 -- appveyor.yml | 5 ----- 2 files changed, 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index c7b8d1e9..ecdf6e56 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,8 +63,6 @@ matrix: env: DB=mariadb:10.5 BENCH=1 SKIP_LEAK=1 - node_js: "12" env: DB=mariadb:10.5 MAXSCALE_VERSION=2.5.4 MAXSCALE_TEST_DISABLE=true SKIP_LEAK=1 - - node_js: "12" - env: DB=mariadb:10.1 SKIP_LEAK=1 - node_js: "12" env: DB=mariadb:10.2 SKIP_LEAK=1 - node_js: "12" diff --git a/appveyor.yml b/appveyor.yml index 4584bd7f..66207f02 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,11 +47,6 @@ environment: nodejs_version: "12" SKIP_LEAK: "1" - - DB: '10.1.46' - MEM: "21" - nodejs_version: "12" - SKIP_LEAK: "1" - cache: - node_modules From 1e358d7d55e042117f7d07ec66a0a11598fdf4bf Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 1 Feb 2021 19:02:34 +0100 Subject: [PATCH 10/13] [misc] authentication plugin event multiple emit correction --- lib/cmd/handshake/auth/plugin-auth.js | 1 - lib/cmd/handshake/handshake.js | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/cmd/handshake/auth/plugin-auth.js b/lib/cmd/handshake/auth/plugin-auth.js index 91af775e..6d85dcca 100644 --- a/lib/cmd/handshake/auth/plugin-auth.js +++ b/lib/cmd/handshake/auth/plugin-auth.js @@ -12,7 +12,6 @@ class PluginAuth extends Command { } successSend(packet, out, opts, info) { - this.emit('end'); this.multiAuthResolver(packet, out, opts, info); } } diff --git a/lib/cmd/handshake/handshake.js b/lib/cmd/handshake/handshake.js index 29c7f325..fa3794ab 100644 --- a/lib/cmd/handshake/handshake.js +++ b/lib/cmd/handshake/handshake.js @@ -69,7 +69,6 @@ class Handshake extends Command { ClientHandshakeResponse.send(this, out, opts, handshake.pluginName, info); }.bind(this) ); - return (this.onPacketReceive = this.handshakeResult); } else { return this.throwNewError( 'Trying to connect with ssl, but ssl not enabled in the server', From edf4fe0a6b54258c5fd790ebbb06de091ddb3881 Mon Sep 17 00:00:00 2001 From: kolzeq Date: Mon, 15 Feb 2021 14:41:03 +0100 Subject: [PATCH 11/13] [misc] test addition * adding travis PAM test * compresssion with multiple packet --- .travis/docker-compose.yml | 1 + .travis/maxscale-compose.yml | 10 ++++----- .travis/maxscale/Dockerfile | 5 +++-- .travis/maxscale/mariadb.repo | 4 ++-- .travis/maxscale/maxscale.cnf | 7 +++--- .travis/{sql => pam}/pam.sh | 0 .travis/script.sh | 30 +++++++++++++++++--------- .travis/sql/dbinit.sql | 10 ++++++--- test/integration/test-auth-plugin.js | 2 +- test/integration/test-compression.js | 32 ++++++++++++++++++++++++++++ 10 files changed, 75 insertions(+), 26 deletions(-) rename .travis/{sql => pam}/pam.sh (100%) diff --git a/.travis/docker-compose.yml b/.travis/docker-compose.yml index e9664e14..6821ee50 100644 --- a/.travis/docker-compose.yml +++ b/.travis/docker-compose.yml @@ -8,6 +8,7 @@ services: volumes: - $SSLCERT:/etc/sslcert - $ENTRYPOINT:/docker-entrypoint-initdb.d + - $ENTRYPOINT_PAM:/pam environment: MYSQL_DATABASE: testn MYSQL_ALLOW_EMPTY_PASSWORD: 1 diff --git a/.travis/maxscale-compose.yml b/.travis/maxscale-compose.yml index 842f77da..aae98524 100644 --- a/.travis/maxscale-compose.yml +++ b/.travis/maxscale-compose.yml @@ -2,20 +2,20 @@ version: '2.1' services: db: image: $DB - command: --innodb-log-file-size=400m --max-allowed-packet=40m --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 $ADDITIONAL_CONF + command: --max-connections=500 --max-allowed-packet=$PACKET --innodb-log-file-size=$INNODB_LOG_FILE_SIZE --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 ports: - 3305:3306 volumes: - $SSLCERT:/etc/sslcert - $ENTRYPOINT:/docker-entrypoint-initdb.d + - $ENTRYPOINT_PAM:/pam environment: - MYSQL_DATABASE: testn + MYSQL_DATABASE: testj MYSQL_ALLOW_EMPTY_PASSWORD: 1 healthcheck: - test: ["CMD", "mysql", "--protocol=tcp", "-ubob", "-h127.0.0.1"] - timeout: 50s + test: ["CMD", "mysql", "--protocol=tcp", "-ubob", "-h127.0.0.1", "-ubob"] + timeout: 20s retries: 10 - interval: 5s maxscale: depends_on: diff --git a/.travis/maxscale/Dockerfile b/.travis/maxscale/Dockerfile index 4c6009a2..0a60b4e7 100644 --- a/.travis/maxscale/Dockerfile +++ b/.travis/maxscale/Dockerfile @@ -1,11 +1,12 @@ FROM centos:7 ARG MAXSCALE_VERSION -ENV MAXSCALE_VERSION ${MAXSCALE_VERSION:-2.5.4} +ENV MAXSCALE_VERSION ${MAXSCALE_VERSION:-2.5.3} COPY maxscale/mariadb.repo /etc/yum.repos.d/ + RUN rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB \ - && yum -y install https://downloads.mariadb.com/MaxScale/${MAXSCALE_VERSION}/centos/7/x86_64/maxscale-${MAXSCALE_VERSION}-1.rhel.7.x86_64.rpm \ + && yum -y install https://downloads.mariadb.com/MaxScale/${MAXSCALE_VERSION}/centos/7/x86_64/maxscale-${MAXSCALE_VERSION}-2.rhel.7.x86_64.rpm \ && yum -y update RUN yum -y install maxscale-${MAXSCALE_VERSION} MariaDB-client \ diff --git a/.travis/maxscale/mariadb.repo b/.travis/maxscale/mariadb.repo index d15c559d..055f3b5c 100644 --- a/.travis/maxscale/mariadb.repo +++ b/.travis/maxscale/mariadb.repo @@ -1,7 +1,7 @@ -# MariaDB 10.3 CentOS repository list - created 2018-11-09 14:50 UTC +# MariaDB 10.2 CentOS repository list - created 2017-06-05 08:06 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB -baseurl = http://yum.mariadb.org/10.3/centos7-amd64 +baseurl = http://yum.mariadb.org/10.2/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 \ No newline at end of file diff --git a/.travis/maxscale/maxscale.cnf b/.travis/maxscale/maxscale.cnf index 46254ac8..61fe0651 100644 --- a/.travis/maxscale/maxscale.cnf +++ b/.travis/maxscale/maxscale.cnf @@ -46,6 +46,7 @@ servers=server1 user=boby password=heyPassw0@rd monitor_interval=2000 +failcount=50 [MariaDB-Monitor2] type=monitor @@ -54,6 +55,7 @@ servers=server2 user=boby password=heyPassw0@rd monitor_interval=2000 +failcount=50 # Service definitions # @@ -66,9 +68,8 @@ monitor_interval=2000 [Read-Only-Service] type=service -router=readwritesplit -version_string=10.5.99-MariaDB-maxScale -servers=server2 +router=readconnroute +servers=server1 user=boby password=heyPassw0@rd router_options=slave diff --git a/.travis/sql/pam.sh b/.travis/pam/pam.sh similarity index 100% rename from .travis/sql/pam.sh rename to .travis/pam/pam.sh diff --git a/.travis/script.sh b/.travis/script.sh index 746da622..68665be1 100644 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -36,6 +36,7 @@ else export TEST_HOST=mariadb.example.com export COMPOSE_FILE=.travis/docker-compose.yml export ENTRYPOINT=$PROJ_PATH/.travis/sql + export ENTRYPOINT_PAM=$PROJ_PATH/.travis/pam if [[ "$DB" == build* ]] ; then .travis/build/build.sh @@ -65,16 +66,25 @@ else docker-compose -f ${COMPOSE_FILE} exec maxscale tail -n 500 /var/log/maxscale/maxscale.log fi -# if [ -z "$MAXSCALE_VERSION" ] ; then -# docker-compose -f .travis/docker-compose.yml exec -u root db bash /pam/pam.sh -# sleep 1 -# docker-compose -f .travis/docker-compose.yml stop db -# sleep 1 -# docker-compose -f .travis/docker-compose.yml up -d -# docker-compose -f .travis/docker-compose.yml logs db -# node --version -# node .travis/wait-for-docker-up.js -# fi + + if [[ "$DB" != mysql* ]] ; then + ################################################################################################################### + # execute pam + ################################################################################################################### + docker-compose -f ${COMPOSE_FILE} exec -u root db bash /pam/pam.sh + sleep 1 + docker-compose -f ${COMPOSE_FILE} restart db + sleep 5 + + ################################################################################################################### + # wait for restart + ################################################################################################################### + node .travis/wait-for-docker-up.js + docker-compose -f ${COMPOSE_FILE} logs + if [ -n "$MAXSCALE_VERSION" ] ; then + docker-compose -f ${COMPOSE_FILE} exec maxscale tail -n 500 /var/log/maxscale/maxscale.log + fi + fi fi if [ -n "$LINT" ] ; then npm run test:lint; fi diff --git a/.travis/sql/dbinit.sql b/.travis/sql/dbinit.sql index ebfaaedb..b2cbccc9 100644 --- a/.travis/sql/dbinit.sql +++ b/.travis/sql/dbinit.sql @@ -1,9 +1,13 @@ +CREATE USER 'bob'@'localhost'; +GRANT ALL ON *.* TO 'bob'@'localhost' with grant option; + CREATE USER 'bob'@'%'; GRANT ALL ON *.* TO 'bob'@'%' with grant option; -/*M!100501 CREATE USER 'boby'@'%' identified by 'heyPassw0@rd'*/; -/*M!100501 GRANT ALL ON *.* TO 'boby'@'%' with grant option*/; +CREATE USER 'boby'@'%' identified by 'heyPassw0@rd'; +GRANT ALL ON *.* TO 'boby'@'%' /*M!100401 identified by 'heyPassw0@rd'*/ with grant option; -FLUSH PRIVILEGES; +CREATE USER 'boby'@'localhost' identified by 'heyPassw0@rd'; +GRANT ALL ON *.* TO 'boby'@'localhost' /*M!100401 identified by 'heyPassw0@rd'*/ with grant option; CREATE DATABASE test2; \ No newline at end of file diff --git a/test/integration/test-auth-plugin.js b/test/integration/test-auth-plugin.js index 3b5c324c..62e9654a 100644 --- a/test/integration/test-auth-plugin.js +++ b/test/integration/test-auth-plugin.js @@ -221,7 +221,7 @@ describe('authentication plugin', () => { it('dialog authentication plugin', function (done) { //pam is set using .travis/sql/pam.sh - if (!process.env.TRAVIS || process.env.MAXSCALE_TEST_DISABLE) this.skip(); + if (process.env.MAXSCALE_TEST_DISABLE) this.skip(); if (!shareConn.info.isMariaDB()) this.skip(); this.timeout(10000); diff --git a/test/integration/test-compression.js b/test/integration/test-compression.js index ecf4163a..f48e26b8 100644 --- a/test/integration/test-compression.js +++ b/test/integration/test-compression.js @@ -38,6 +38,38 @@ describe('Compression', function () { .catch(done); }); + const generateLongText = function (len) { + let t = ''; + for (let i = 0; i < len; i++) { + t += 'a'; + } + return t; + }; + + it('test compression multiple packet', function (done) { + this.timeout(30000); + if (maxAllowedSize < 35000000) this.skip(); + + conn.query( + 'CREATE TEMPORARY TABLE compressTab (t1 LONGTEXT, t2 LONGTEXT, t3 LONGTEXT, t4 LONGTEXT)' + ); + + const longText = generateLongText(20000000); + const mediumText = generateLongText(10000000); + const smallIntText = generateLongText(60000); + conn + .query('INSERT INTO compressTab values (?,?,?,?)', [ + longText, + mediumText, + smallIntText, + 'expected' + ]) + .then(() => { + done(); + }) + .catch(done); + }); + it('simple select 1', function (done) { conn .query('SELECT 1') From 79c625782f853addd6bcf8f922d170f66c005a9b Mon Sep 17 00:00:00 2001 From: kolzeq Date: Tue, 16 Feb 2021 12:34:21 +0100 Subject: [PATCH 12/13] [misc] test correction * updating maxscale to recent version * updating 10.6 with galera 4 --- .travis.yml | 2 +- .travis/build/Dockerfile | 14 ++++---- .travis/maxscale-compose.yml | 9 +++--- .travis/maxscale/Dockerfile | 4 +-- .../test-additional-server-info.js | 5 ++- test/integration/test-cluster.js | 29 +++++++++++------ test/integration/test-connection-meta.js | 2 +- test/integration/test-pool-callback.js | 2 +- test/integration/test-pool.js | 6 ++-- test/integration/test-query-values-in-sql.js | 32 ++++++++++++------- test/tools/proxy.js | 14 ++++++-- 11 files changed, 77 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index ecdf6e56..d008ec92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,7 +62,7 @@ matrix: - node_js: "12" env: DB=mariadb:10.5 BENCH=1 SKIP_LEAK=1 - node_js: "12" - env: DB=mariadb:10.5 MAXSCALE_VERSION=2.5.4 MAXSCALE_TEST_DISABLE=true SKIP_LEAK=1 + env: DB=mariadb:10.5 MAXSCALE_VERSION=2.5.7 MAXSCALE_TEST_DISABLE=true SKIP_LEAK=1 - node_js: "12" env: DB=mariadb:10.2 SKIP_LEAK=1 - node_js: "12" diff --git a/.travis/build/Dockerfile b/.travis/build/Dockerfile index 73042544..e58c9966 100644 --- a/.travis/build/Dockerfile +++ b/.travis/build/Dockerfile @@ -63,14 +63,14 @@ 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 apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net F1656F24C74CD1D8 -#RUN echo 'deb http://yum.mariadb.org/galera/repo/deb xenial main' > /etc/apt/sources.list.d/galera-test-repo.list -#RUN apt-get update -y +RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db +RUN apt-key adv --recv-keys --keyserver ha.pool.sks-keyservers.net F1656F24C74CD1D8 +RUN echo 'deb http://yum.mariadb.org/galera/repo4/deb xenial 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 libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 +RUN apt-get install -y curl libdbi-perl rsync socat libnuma1 libaio1 zlib1g-dev libreadline5 libjemalloc1 libsnappy1v5 libcrack2 apt-utils -#RUN apt-get install -y galera3 +RUN apt-get install -y galera4 COPY *.deb /root/ RUN chmod 777 /root/* @@ -81,6 +81,8 @@ RUN dpkg -R --unpack /root/ RUN apt-get install -f -y RUN ls -lrt /etc/mysql RUN ls -lrt /etc/mysql/mariadb.conf.d +RUN find / -type f -name "*tz_info*" +RUN ls -lrt /usr/bin/ RUN rm -rf /var/lib/apt/lists/* \ && sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/mariadb.conf.d/*.cnf \ && rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ diff --git a/.travis/maxscale-compose.yml b/.travis/maxscale-compose.yml index aae98524..744d0503 100644 --- a/.travis/maxscale-compose.yml +++ b/.travis/maxscale-compose.yml @@ -2,7 +2,7 @@ version: '2.1' services: db: image: $DB - command: --max-connections=500 --max-allowed-packet=$PACKET --innodb-log-file-size=$INNODB_LOG_FILE_SIZE --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 + command: --max-connections=500 --innodb-log-file-size=400m --max-allowed-packet=40m --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --ssl-ca=/etc/sslcert/ca.crt --ssl-cert=/etc/sslcert/server.crt --ssl-key=/etc/sslcert/server.key --bind-address=0.0.0.0 ports: - 3305:3306 volumes: @@ -10,12 +10,13 @@ services: - $ENTRYPOINT:/docker-entrypoint-initdb.d - $ENTRYPOINT_PAM:/pam environment: - MYSQL_DATABASE: testj + MYSQL_DATABASE: testn MYSQL_ALLOW_EMPTY_PASSWORD: 1 healthcheck: - test: ["CMD", "mysql", "--protocol=tcp", "-ubob", "-h127.0.0.1", "-ubob"] - timeout: 20s + test: ["CMD", "mysql", "--protocol=tcp", "-ubob", "-h127.0.0.1"] + timeout: 50s retries: 10 + interval: 5s maxscale: depends_on: diff --git a/.travis/maxscale/Dockerfile b/.travis/maxscale/Dockerfile index 0a60b4e7..acacd3ef 100644 --- a/.travis/maxscale/Dockerfile +++ b/.travis/maxscale/Dockerfile @@ -1,12 +1,12 @@ FROM centos:7 ARG MAXSCALE_VERSION -ENV MAXSCALE_VERSION ${MAXSCALE_VERSION:-2.5.3} +ENV MAXSCALE_VERSION ${MAXSCALE_VERSION:-2.5.7} COPY maxscale/mariadb.repo /etc/yum.repos.d/ RUN rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB \ - && yum -y install https://downloads.mariadb.com/MaxScale/${MAXSCALE_VERSION}/centos/7/x86_64/maxscale-${MAXSCALE_VERSION}-2.rhel.7.x86_64.rpm \ + && yum -y install https://downloads.mariadb.com/MaxScale/${MAXSCALE_VERSION}/centos/7/x86_64/maxscale-${MAXSCALE_VERSION}-1.rhel.7.x86_64.rpm \ && yum -y update RUN yum -y install maxscale-${MAXSCALE_VERSION} MariaDB-client \ diff --git a/test/integration/test-additional-server-info.js b/test/integration/test-additional-server-info.js index ce76adbd..8e4407d3 100644 --- a/test/integration/test-additional-server-info.js +++ b/test/integration/test-additional-server-info.js @@ -23,7 +23,10 @@ describe('server additional information API', () => { if (!process.env.DB) this.skip(); if (process.env.DB.indexOf(':') != -1) { const serverInfo = process.env.DB.split(':'); - assert.equal(serverInfo[0] === 'mariadb', shareConn.info.isMariaDB()); + assert.equal( + serverInfo[0] === 'mariadb' || serverInfo[0] === 'build', + shareConn.info.isMariaDB() + ); } else { //appveyor use mariadb only assert(shareConn.info.isMariaDB()); diff --git a/test/integration/test-cluster.js b/test/integration/test-cluster.js index fd588deb..0e0ad757 100644 --- a/test/integration/test-cluster.js +++ b/test/integration/test-cluster.js @@ -424,7 +424,7 @@ describe('cluster', function () { it('reusing node after timeout', function (done) { if (process.env.SKYSQL || process.env.SKYSQL_HA) this.skip(); - this.timeout(20000); + this.timeout(30000); const cl = get3NodeClusterWithProxy({ restoreNodeTimeout: 500 }, basePromise); const poolCluster = cl.cluster; const proxy = cl.proxy; @@ -1192,17 +1192,20 @@ describe('cluster', function () { const connOption1 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node1'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); const connOption2 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node2'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); const connOption3 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node3'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); poolCluster.add('node1', connOption1); @@ -1217,17 +1220,20 @@ describe('cluster', function () { const connOption1 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node1'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); const connOption2 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node2'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); const connOption3 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node3'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); poolCluster.add('node1', connOption1); @@ -1248,7 +1254,8 @@ describe('cluster', function () { port: Conf.baseConfig.port, proxyPort: 4000, host: Conf.baseConfig.host, - resetAfterUse: false + resetAfterUse: false, + trace: true }); const connOption2 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node2'", @@ -1258,13 +1265,15 @@ describe('cluster', function () { socketTimeout: 200, acquireTimeout: 250, port: 4000, - resetAfterUse: false + resetAfterUse: false, + trace: true }); const connOption3 = Object.assign({}, Conf.baseConfig, { initSql: "set @node='node3'", connectionLimit: 1, - resetAfterUse: false + resetAfterUse: false, + trace: true }); poolCluster.add('node1', connOption1); diff --git a/test/integration/test-connection-meta.js b/test/integration/test-connection-meta.js index 2c3cdd8d..469bf00e 100644 --- a/test/integration/test-connection-meta.js +++ b/test/integration/test-connection-meta.js @@ -37,7 +37,7 @@ describe('Connection meta', function () { it('isMariaDB', () => { const isMariadb = shareConn.info.isMariaDB(); if (process.env.DB) { - if (process.env.DB === 'build') { + if (process.env.DB.startsWith('build')) { assert(isMariadb); } else { //Appveyor test only mariadb, travis use docker image with DB=mariadb/mysql:version diff --git a/test/integration/test-pool-callback.js b/test/integration/test-pool-callback.js index 4a5249bf..319cb602 100644 --- a/test/integration/test-pool-callback.js +++ b/test/integration/test-pool-callback.js @@ -643,7 +643,7 @@ describe('Pool callback', () => { } else { setTimeout(() => { assert.equal(pool.totalConnections(), 10); - assert.equal(pool.idleConnections(), 10); + assert.isTrue(pool.idleConnections() === 9 || pool.idleConnections() === 10); }, 5); setTimeout(() => { diff --git a/test/integration/test-pool.js b/test/integration/test-pool.js index 158c244b..b1c11c69 100644 --- a/test/integration/test-pool.js +++ b/test/integration/test-pool.js @@ -1092,8 +1092,10 @@ describe('Pool', () => { setTimeout(() => { //wait for 2 second > idleTimeout - assert.equal(pool.totalConnections(), 8); - assert.equal(pool.idleConnections(), 8); + //minimumIdle-1 is possible after reaching idleTimeout and connection + // is still not recreated + assert.isTrue(pool.totalConnections() === 8 || pool.totalConnections() === 7); + assert.isTrue(pool.idleConnections() === 8 || pool.idleConnections() === 7); }, 2000); setTimeout(() => { diff --git a/test/integration/test-query-values-in-sql.js b/test/integration/test-query-values-in-sql.js index 53f3da29..e8cd35cb 100644 --- a/test/integration/test-query-values-in-sql.js +++ b/test/integration/test-query-values-in-sql.js @@ -20,7 +20,7 @@ describe('sql template strings', () => { values: [value] }); assert.strictEqual(res[0].t, value); - conn.end(); + await conn.end(); }); it('batch with parameters', async () => { @@ -37,7 +37,7 @@ describe('sql template strings', () => { values: [value] }); assert.strictEqual(res[0].t, value); - conn.end(); + await conn.end(); }); it('callback query with parameters', (done) => { @@ -71,12 +71,14 @@ describe('sql template strings', () => { }, (err, res) => { if (err) { - conn.end(); - done(err); + conn.end(() => { + done(err); + }); } else { assert.strictEqual(res[0].t, value); - conn.end(); - done(); + conn.end(() => { + done(); + }); } } ); @@ -126,12 +128,14 @@ describe('sql template strings', () => { }, (err, res) => { if (err) { - conn.end(); - done(err); + conn.end(() => { + done(err); + }); } else { assert.strictEqual(res[0].t, value); - conn.end(); - done(); + conn.end(() => { + done(); + }); } } ); @@ -166,7 +170,9 @@ describe('sql template strings', () => { return pool.query('drop table pool_query_param'); }) .then(() => { - pool.end(); + return pool.end(); + }) + .then(() => { done(); }) .catch(done); @@ -190,7 +196,9 @@ describe('sql template strings', () => { return pool.query('drop table pool_parse_batch'); }) .then(() => { - pool.end(); + return pool.end(); + }) + .then(() => { done(); }) .catch(done); diff --git a/test/tools/proxy.js b/test/tools/proxy.js index 5e2100a3..ac6dfdb0 100644 --- a/test/tools/proxy.js +++ b/test/tools/proxy.js @@ -86,9 +86,18 @@ function Proxy(args) { } }); server.on('error', (err) => { - if (log) console.log('proxy server error : ' + err); - throw err; + if (err.code === 'EADDRINUSE') { + console.log('Address in use, retrying...'); + setTimeout(() => { + server.close(); + server.listen(LOCAL_PORT); + }, 1000); + } else { + if (log) console.log('proxy server error : ' + err); + throw err; + } }); + server.on('close', () => { if (log) console.log('closing proxy server'); sockets.forEach((socket) => { @@ -113,6 +122,7 @@ function Proxy(args) { }); server.listen(LOCAL_PORT); + if (log) console.log('TCP server accepting connection on port: ' + LOCAL_PORT); }; From 5a29ea60f51b2d3e84fa06e1fbce02e03bc5fcaf Mon Sep 17 00:00:00 2001 From: kolzeq Date: Tue, 16 Feb 2021 14:06:08 +0100 Subject: [PATCH 13/13] Bump 2.5.3 --- CHANGELOG.md | 8 ++++++++ package.json | 18 +++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e4991f6..f246c867 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## [2.5.3](https://github.com/mariadb-corporation/mariadb-connector-nodejs/tree/2.5.3) (16 Feb 2021) +[Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-nodejs/compare/2.5.2...2.5.3) + +* [CONJS-157] Batch error when setting maxAllowedPacket less than an insert parameter value +* [CONJS-158] use BigInt constructor in place of literal to ensure maximum compatibility +* [CONJS-160] Wrong definition for typescript PoolConnection.release +* [CONJS-159] test 10.6 server latest build + ## [2.5.2](https://github.com/mariadb-corporation/mariadb-connector-nodejs/tree/2.5.2) (04 Dec 2020) [Full Changelog](https://github.com/mariadb-corporation/mariadb-connector-nodejs/compare/2.5.1...2.5.2) diff --git a/package.json b/package.json index 4464768e..811e60be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mariadb", - "version": "2.5.2", + "version": "2.5.3", "description": "fast mariadb/mysql connector.", "main": "promise.js", "types": "types/index.d.ts", @@ -46,31 +46,31 @@ "license": "LGPL-2.1-or-later", "dependencies": { "@types/geojson": "^7946.0.7", - "@types/node": "^14.14.7", + "@types/node": "^14.14.28", "denque": "^1.4.1", "iconv-lite": "^0.6.2", "long": "^4.0.0", - "moment-timezone": "^0.5.32", + "moment-timezone": "^0.5.33", "please-upgrade-node": "^3.2.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^4.7.0", - "@typescript-eslint/parser": "^4.7.0", + "@typescript-eslint/eslint-plugin": "^4.15.1", + "@typescript-eslint/parser": "^4.15.1", "benchmark": "^2.1.4", - "chai": "^4.2.0", + "chai": "^4.3.0", "codecov": "^3.8.1", "colors": "^1.4.0", "dom-parser": "^0.1.6", "error-stack-parser": "^2.0.6", - "eslint": "^7.13.0", + "eslint": "^7.20.0", "eslint-config-prettier": "^6.15.0", "eslint-plugin-markdown": "^1.0.1", "eslint-plugin-prettier": "^3.1.0", - "mocha": "^8.2.1", + "mocha": "^8.3.0", "mocha-lcov-reporter": "^1.3.0", "nyc": "^15.0.0", "prettier": "^2.1.2", - "typescript": "^4.0.5" + "typescript": "^4.1.5" }, "bugs": { "url": "https://jira.mariadb.org/projects/CONJS/"