Skip to content

Commit 1cabf65

Browse files
author
yq
authored
Merge branch 'sidorares:master' into release-idle-connection
2 parents 16f1f39 + ba15fe2 commit 1cabf65

31 files changed

+2806
-2086
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [16.x]
21+
node-version: [18.x]
2222
mysql-version: ["mysql:8.0.18"]
2323
use-compression: [0]
2424
use-tls: [0]

.github/workflows/ci-linux.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
node-version: [16.x]
32+
node-version: [16.x, 18.x]
3333
mysql-version: ["mysql:8.0.18", "mysql:8.0.22", "mysql:5.7"]
3434
use-compression: [0]
3535
use-tls: [0]
@@ -64,15 +64,15 @@ jobs:
6464
name: Node.js ${{ matrix.node-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
6565

6666
steps:
67-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v3
6868
- name: Set up MySQL
6969
run: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=1 -e MYSQL_ROOT_PASSWORD=${{ env.MYSQL_PASSWORD }} -e MYSQL_DATABASE=${{ env.MYSQL_DATABASE }} -v $PWD/mysqldata:/var/lib/mysql/ -v $PWD/examples/custom-conf:/etc/mysql/conf.d -v $PWD/examples/ssl/certs:/certs -p ${{ env.MYSQL_PORT }}:3306 ${{ matrix.mysql-version }}
7070
- name: Set up Node.js ${{ matrix.node-version }}
71-
uses: actions/setup-node@v2
71+
uses: actions/setup-node@v3
7272
with:
7373
node-version: ${{ matrix.node-version }}
7474
- name: Cache dependencies
75-
uses: actions/cache@v2
75+
uses: actions/cache@v3
7676
with:
7777
path: ~/.npm
7878
key: npm-${{ hashFiles('package-lock.json') }}
@@ -93,6 +93,7 @@ jobs:
9393
path: coverage/cobertura-coverage.xml
9494

9595
coverage:
96+
permissions: write-all
9697
needs: [ tests-linux ]
9798
runs-on: ubuntu-latest
9899
steps:
@@ -117,6 +118,7 @@ jobs:
117118

118119
- name: Display coverage
119120
uses: ewjoachim/coverage-comment-action@v1
121+
continue-on-error: true
120122
with:
121123
COVERAGE_FILE: "Cobertura.xml"
122124
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [16.x]
21+
node-version: [16.x, 18.x]
2222
mysql-version: ['8.0']
2323
use-compression: [0, 1]
2424
use-tls: [0, 1]
2525

2626
name: Node.js ${{ matrix.node-version }} - DB ${{ matrix.mysql-version }} - SSL=${{matrix.use-tls}} Compression=${{matrix.use-compression}}
2727

2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
3030
- name: Set up MySQL
3131
uses: shogo82148/actions-setup-mysql@v1
3232
with:
3333
mysql-version: ${{ matrix.mysql-version }}
3434
- name: Set up Node.js ${{ matrix.node-version }}
35-
uses: actions/setup-node@v2
35+
uses: actions/setup-node@v3
3636
with:
3737
node-version: ${{ matrix.node-version }}
3838
- name: Cache dependencies
39-
uses: actions/cache@v2
39+
uses: actions/cache@v3
4040
with:
4141
path: ~/.npm
4242
key: npm-${{ hashFiles('package-lock.json') }}

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
lint-js:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Use Node.js ${{ env.NODE_VERSION }}
17-
uses: actions/setup-node@v2
17+
uses: actions/setup-node@v3
1818
with:
1919
node-version: ${{ env.NODE_VERSION }}
2020
- name: Cache dependencies
21-
uses: actions/cache@v2
21+
uses: actions/cache@v3
2222
with:
2323
path: ~/.npm
2424
key: npm-${{ hashFiles('package-lock.json') }}

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
name: release-please
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: google-github-actions/release-please-action@v3
11+
id: release
12+
with:
13+
release-type: node
14+
package-name: mysql2
15+
changelog-path: 'Changelog.md'
16+
17+
- uses: actions/checkout@v3
18+
if: ${{ steps.release.outputs.release_created }}
19+
20+
- uses: actions/setup-node@v3
21+
if: ${{ steps.release.outputs.release_created }}
22+
with:
23+
node-version: 16
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- run: npm ci
27+
if: ${{ steps.release.outputs.release_created }}
28+
29+
- run: npm publish
30+
if: ${{ steps.release.outputs.release_created }}
31+
env:
32+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Changelog.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,73 @@
1+
# Changelog
2+
3+
## [3.0.1](https://github.com/sidorares/node-mysql2/compare/v3.0.0...v3.0.1) (2023-01-13)
4+
5+
6+
### Miscellaneous Chores
7+
8+
* release 3.0.1 ([d5a6b2c](https://github.com/sidorares/node-mysql2/commit/d5a6b2ccccc7db4176c880e83c70ccd0be4ad81e))
9+
10+
## [3.0.0](https://github.com/sidorares/node-mysql2/compare/v3.0.0-rc.1...v3.0.0) (2023-01-12)
11+
12+
* named-placeholders library is updated to use newer `lru-cache` dependency, allowing it do dedupe and be shared between mysql2 and named-placeholders - https://github.com/sidorares/node-mysql2/issues/1711, https://github.com/mysqljs/named-placeholders/pull/19
13+
* `chai` and `mocha` moved to devDependencies #1774
14+
* Amazon RDS ssl certificates updated including AWS China #1754
15+
* `TCP_NODELAY` flag enabled, avoiding long connect timeout in some scenarios #1751
16+
* typing improvements: #1675, #1674
17+
* fix: ensure pooled connections get released #1666
18+
19+
### Miscellaneous Chores
20+
21+
* release 3.0.0 ([11692b2](https://github.com/sidorares/node-mysql2/commit/11692b223ff26784089f444ca6291295bd0e405e))
22+
23+
## [3.0.0-rc.1](https://github.com/sidorares/node-mysql2/compare/v2.3.3...v3.0.0-rc.1) (2022-11-06)
24+
25+
26+
### Bug Fixes
27+
28+
* **typings:** Add the infileStreamFactory option to the type definition ([bf9cc4c](https://github.com/sidorares/node-mysql2/commit/bf9cc4c41e72f4a9014659a22b131739524bda1c))
29+
* webpack projects no longer show warning for cardinal dependency ([26c56ae](https://github.com/sidorares/node-mysql2/commit/26c56ae64846814eb8234c0d352871a7b6651d66))
30+
31+
32+
### Miscellaneous Chores
33+
34+
* v3.0.0-rc.1 changes ([1b684bb](https://github.com/sidorares/node-mysql2/commit/1b684bbf8047200e5de5dd18874872880237de2f))
35+
36+
3.0.0-rc.1 ( 6/11/2021 )
37+
- fix .ping() return value signature #1650
38+
- documentation: clarify `SUM()` and `AVG()`
39+
return types difference with mysqljs/myql #1649
40+
- misc: add release-please action #1631, #1647
41+
- fix: .end() callback is not called
42+
when connection is in closed state #1642, #1638
43+
- typescript: getConnection typings fix #1620
44+
- fix uncatchable exception #1359
45+
- add mysql_clear_password built in support #1552
46+
- typescript: typings unit test, variouts type
47+
improvements, server protocol additions #1610, #1610
48+
- typescript: more complete way of adding
49+
typings for the Server module #1606
50+
- typescript, documentation: improve prepared
51+
typings statements #1493
52+
- typescript: add type declarations for Prepare
53+
& PrepareStatementInfo #1565
54+
- fix: webpack projects no longer show warning
55+
for cardinal dependency #1589
56+
- typescript: accept Buffer and Buffer[] in
57+
typings for key, cert, and ca #1599
58+
- fix: use rotatingXor instead of xor in
59+
sha256_password plugin #1592, #1044
60+
- documentation: add Simplified Chinese #1572
61+
- fix: add type as an alias to columnType #1546, #1549
62+
- Update collation list up to MySQL 8.0.26 #1410
63+
- typescript: Add minVersion for ssl option. #1517
64+
- Add support for multi-factor authentication #1436
65+
- typescript: add namedPlaceholders option to
66+
QueryOptions interface #1475
67+
- fix: update how the ECONNRESET error is
68+
caught when connection already closing #1438
69+
70+
171
2.3.3 ( 14/11/2021 )
272
- no changes compared to 2.3.3-rc.0
373

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Windows Build][appveyor-image]][appveyor-url]
99
[![License][license-image]][license-url]
1010

11-
[简体中文 Simplified Chinese](./documentation_zh-cn/)
11+
English | [简体中文](./documentation_zh-cn/)
1212

1313
> MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more](https://github.com/sidorares/node-mysql2/tree/master/documentation)
1414
@@ -250,7 +250,9 @@ con.query({ sql: 'select 1 as foo, 2 as foo', rowsAsArray: true }, function(err,
250250
251251
MySQL2 is mostly API compatible with [Node MySQL][node-mysql]. You should check their API documentation to see all available API options.
252252
253-
If you find any incompatibility with [Node MySQL][node-mysql], Please report via Issue tracker. We will fix reported incompatibility on priority basis.
253+
One known incompatibility is that `DECIMAL` values are returned as strings whereas in [Node MySQL][node-mysql] they are returned as numbers. This includes the result of `SUM()` and `AVG()` functions when applied to `INTEGER` arguments. This is done deliberately to avoid loss of precision - see https://github.com/sidorares/node-mysql2/issues/935.
254+
255+
If you find any other incompatibility with [Node MySQL][node-mysql], Please report via Issue tracker. We will fix reported incompatibility on priority basis.
254256
255257
## Documentation
256258

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
**Please do not file a public ticket** mentioning the vulnerability.
66

7-
If you believe you found a security vulnerability please contact [current maintainer](mailto:[email protected]?subject=mysql2%20security%20vulnerability%20report) as soon as practical - the team will triage severity and plan for rectification.
7+
If you believe you found a security vulnerability please contact [current maintainer](mailto:andrey.sidorov?subject=mysql2%20security%20vulnerability%20report) as soon as practical - the team will triage severity and plan for rectification.

documentation_zh-cn/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[![Windows Build][appveyor-image]][appveyor-url]
99
[![License][license-image]][license-url]
1010

11+
[English](../README.md) | 简体中文
12+
1113
> 适用于Node.js的MySQL客户端,专注于性能优化。支持SQL预处理、非UTF-8编码支持、二进制文件编码支持、压缩和SSL等等 [查看更多](https://github.com/sidorares/node-mysql2/tree/master/documentation)
1214
1315
__目录__

0 commit comments

Comments
 (0)