Skip to content

Commit f5bb633

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/master' into fix/streaming-interface-should-provide-dataset-index
2 parents ed186f8 + 9edfd72 commit f5bb633

30 files changed

+5212
-2419
lines changed

.github/workflows/ci-linux.yml

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

.nycrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"all": true,
3+
"include": ["index.js", "promise.js", "lib/**/*.js"],
4+
"exclude": ["mysqldata/**", "node_modules/**", "test/**"],
5+
"reporter": ["text", "lcov", "cobertura"],
6+
"statements": 88,
7+
"branches": 84,
8+
"functions": 77,
9+
"lines": 88,
10+
"checkCoverage": true,
11+
"clean": true
12+
}

Changelog.md

+80-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Changelog
22

3+
## [3.9.7](https://github.com/sidorares/node-mysql2/compare/v3.9.6...v3.9.7) (2024-04-21)
4+
5+
6+
### Bug Fixes
7+
8+
* **security:** sanitize timezone parameter value to prevent code injection ([#2608](https://github.com/sidorares/node-mysql2/issues/2608)) ([7d4b098](https://github.com/sidorares/node-mysql2/commit/7d4b098c7e29d5a6cb9eac2633bfcc2f0f1db713))
9+
10+
## [3.9.6](https://github.com/sidorares/node-mysql2/compare/v3.9.5...v3.9.6) (2024-04-18)
11+
12+
13+
### Bug Fixes
14+
15+
* binary parser sometimes reads out of packet bounds when results contain null and typecast is false ([#2601](https://github.com/sidorares/node-mysql2/issues/2601)) ([705835d](https://github.com/sidorares/node-mysql2/commit/705835d06ff437cf0bf3169dac0a5f68002c4f87))
16+
17+
## [3.9.5](https://github.com/sidorares/node-mysql2/compare/v3.9.4...v3.9.5) (2024-04-17)
18+
19+
20+
### Bug Fixes
21+
22+
* revert breaking change in results creation ([#2591](https://github.com/sidorares/node-mysql2/issues/2591)) ([f7c60d0](https://github.com/sidorares/node-mysql2/commit/f7c60d01a49666130f51d3847ccfdd3d6e3d33e9))
23+
24+
## [3.9.4](https://github.com/sidorares/node-mysql2/compare/v3.9.3...v3.9.4) (2024-04-09)
25+
26+
27+
### Bug Fixes
28+
29+
* **docs:** improve the contribution guidelines ([#2552](https://github.com/sidorares/node-mysql2/issues/2552)) ([8a818ce](https://github.com/sidorares/node-mysql2/commit/8a818ce0f30654eba854759e6409c0ac856fc448))
30+
* **security:** improve results object creation ([#2574](https://github.com/sidorares/node-mysql2/issues/2574)) ([4a964a3](https://github.com/sidorares/node-mysql2/commit/4a964a3910a4b8de008696c554ab1b492e9b4691))
31+
* **security:** improve supportBigNumbers and bigNumberStrings sanitization ([#2572](https://github.com/sidorares/node-mysql2/issues/2572)) ([74abf9e](https://github.com/sidorares/node-mysql2/commit/74abf9ef94d76114d9a09415e28b496522a94805))
32+
33+
## [3.9.3](https://github.com/sidorares/node-mysql2/compare/v3.9.2...v3.9.3) (2024-03-26)
34+
35+
36+
### Bug Fixes
37+
38+
* **security:** improve cache key formation ([#2424](https://github.com/sidorares/node-mysql2/issues/2424)) ([0d54b0c](https://github.com/sidorares/node-mysql2/commit/0d54b0ca6498c823098426038162ef10df02c818))
39+
* Fixes a potential parser cache poisoning attack vulnerability reported by Vsevolod Kokorin (Slonser) of Solidlab
40+
* update Amazon RDS SSL CA cert ([#2131](https://github.com/sidorares/node-mysql2/pull/2131)) ([d9dccfd](https://github.com/sidorares/node-mysql2/commit/d9dccfd837d701f377574b85a05586be89015460))
41+
342
## [3.9.2](https://github.com/sidorares/node-mysql2/compare/v3.9.1...v3.9.2) (2024-02-26)
443

544

@@ -313,50 +352,50 @@
313352

314353
3.0.0-rc.1 ( 6/11/2021 )
315354
- fix .ping() return value signature #1650
316-
- documentation: clarify `SUM()` and `AVG()`
355+
- documentation: clarify `SUM()` and `AVG()`
317356
return types difference with mysqljs/myql #1649
318357
- misc: add release-please action #1631, #1647
319-
- fix: .end() callback is not called
358+
- fix: .end() callback is not called
320359
when connection is in closed state #1642, #1638
321360
- typescript: getConnection typings fix #1620
322361
- fix uncatchable exception #1359
323362
- add mysql_clear_password built in support #1552
324-
- typescript: typings unit test, variouts type
363+
- typescript: typings unit test, variouts type
325364
improvements, server protocol additions #1610, #1610
326-
- typescript: more complete way of adding
365+
- typescript: more complete way of adding
327366
typings for the Server module #1606
328-
- typescript, documentation: improve prepared
367+
- typescript, documentation: improve prepared
329368
typings statements #1493
330-
- typescript: add type declarations for Prepare
369+
- typescript: add type declarations for Prepare
331370
& PrepareStatementInfo #1565
332-
- fix: webpack projects no longer show warning
371+
- fix: webpack projects no longer show warning
333372
for cardinal dependency #1589
334-
- typescript: accept Buffer and Buffer[] in
373+
- typescript: accept Buffer and Buffer[] in
335374
typings for key, cert, and ca #1599
336-
- fix: use rotatingXor instead of xor in
375+
- fix: use rotatingXor instead of xor in
337376
sha256_password plugin #1592, #1044
338377
- documentation: add Simplified Chinese #1572
339378
- fix: add type as an alias to columnType #1546, #1549
340379
- Update collation list up to MySQL 8.0.26 #1410
341380
- typescript: Add minVersion for ssl option. #1517
342381
- Add support for multi-factor authentication #1436
343-
- typescript: add namedPlaceholders option to
382+
- typescript: add namedPlaceholders option to
344383
QueryOptions interface #1475
345-
- fix: update how the ECONNRESET error is
384+
- fix: update how the ECONNRESET error is
346385
caught when connection already closing #1438
347386

348387

349388
2.3.3 ( 14/11/2021 )
350389
- no changes compared to 2.3.3-rc.0
351390

352391
2.3.3-rc.0 ( 5/11/2021 )
353-
- fix ColumnDefinition.db is broken when
354-
encoding is not utf-8 #1423
392+
- fix ColumnDefinition.db is broken when
393+
encoding is not utf-8 #1423
355394
- typeCast: Fix field.length to be number #1427, #1426
356395
- initiall support for coverage reporting in CI #1425
357396
- fix performance regression for results with #1445, #1432
358-
large (300+) number of columns
359-
397+
large (300+) number of columns
398+
360399

361400
2.3.2 ( 16/10/2021 )
362401
- fix regression causing typeCast + JSON field
@@ -365,34 +404,34 @@
365404
2.3.1 ( 15/10/2021 )
366405
- Update error codes up to mysql 8.0.26 #1411
367406
- perf: optimize Query.row call #1408
368-
- build: update to node 12/14/16, migrate from
407+
- build: update to node 12/14/16, migrate from
369408
travis-ci and appveyor to GH actions, add perf
370409
benchmarking workflow #1406, #1399
371410
- perf: avoid leaking TextRow/BinaryRow object #1402
372-
- perf: optimize string decoding by removing
411+
- perf: optimize string decoding by removing
373412
the use of slice() #1401
374413
- perf: cache lazy-evaluated fields #1400
375414
- fix: clear timeout after error #1390
376-
- TS: adds the optional column changedRows to
415+
- TS: adds the optional column changedRows to
377416
ResultSetHeader #1377
378417

379418
2.3.0 ( 5/08/2021 )
380419
- Add PoolCluster promise wrappers #1369, #1363
381420
- support for connect and query timeouts #1364
382421
- add missing query() method on PoolCluster #1362
383-
- fix incorrect parsing of passwords
422+
- fix incorrect parsing of passwords
384423
containing ":" #1357
385-
- handle errors generated by asynchronous
424+
- handle errors generated by asynchronous
386425
authentication plugins #1354
387426
- add proper handshake fatal error handling #1352
388-
- fix tests to work with the latest MySQL
427+
- fix tests to work with the latest MySQL
389428
server versions (up to 8.0.25) #1338
390429
- expose SQL query in errors #1295
391430
- typing and readme docs for rowAsArray #1288
392-
- allow unnamed placeholders even if the
431+
- allow unnamed placeholders even if the
393432
namedPlaceholders flag is enabled #1251
394433
- better ESM support #1217
395-
434+
396435
2.2.5 ( 21/09/2020 )
397436
- typings: add ResultSetHeader #1213
398437

@@ -406,18 +445,18 @@
406445
- Add the authPlugins types to ConnectionOptions #1206
407446

408447
2.2.1 ( 18/09/2020 )
409-
- update package.json files entry to include
448+
- update package.json files entry to include
410449
type definition files #1205
411450

412451
2.2.0 ( 18/09/2020 )
413452
- added TS type definitions #1204, #1028
414-
- better error handling for invalid JSON row
453+
- better error handling for invalid JSON row
415454
responses #915
416455
- fix for iconv-lite and some bundlers issues #1187
417456
- error early when callbacks incorrectly passed #1025
418457
to a promise wrapper
419458
- add support for sha256_password authentication #1153, #1152
420-
plugin
459+
plugin
421460
- handle backpressure when loading data from #1167
422461
file
423462
- Pass in the callback when ending the pool #1170
@@ -438,26 +477,26 @@
438477
- added `enableKeepAlive` connection option #1081, #683
439478

440479
2.0.2
441-
- Fix for clearing connection timeout state when
480+
- Fix for clearing connection timeout state when
442481
connection is re-attempted (failure or success) #1075
443482
- Avoid setting numeric config options to NaN #1074, #721
444483
- PoolCluster#end now accepts a callback function #1065, #1063
445484

446485
2.0.1
447-
- Add missing authPlugins assignment in
486+
- Add missing authPlugins assignment in
448487
ConnectionConfig #1052
449-
- Fix 4.1 auth on old servers not
488+
- Fix 4.1 auth on old servers not
450489
supporting PLUGIN_AUTH #1062, #1054, #1053
451490

452491
2.0.0
453-
- Mysql8 caching_sha2_password - fix bug in
454-
authenticating when password is longer
492+
- Mysql8 caching_sha2_password - fix bug in
493+
authenticating when password is longer
455494
than 19 chars #1044 #1045
456495
- Support ConnectionConfig.flags as an array #1003
457496

458497
2.0.0-alpha1
459-
- MAJOR: new `authPlugins` api replacing
460-
`authSwitchHandler`, added caching_sha2_password
498+
- MAJOR: new `authPlugins` api replacing
499+
`authSwitchHandler`, added caching_sha2_password
461500
and mysql_native_password as default plugins.
462501
Added tests for mysql 8 and ssl. Mysql 8 server
463502
now supported with default settings. #1021, #906, #991
@@ -469,16 +508,16 @@
469508
- fix pool ignoring namedPlaceholders config #1022
470509

471510
1.7.0
472-
- Fix crashing when session info packet does not
511+
- Fix crashing when session info packet does not
473512
start with length-coded string #1004, #989
474513
- build: drop node 4 and 6 and add node v12 #997
475-
- Add support for timezone connection option #996, #15, #262,
514+
- Add support for timezone connection option #996, #15, #262,
476515
#642, #877, #888
477-
- Make mysql2 compatible with minification #992, #890, #899,
516+
- Make mysql2 compatible with minification #992, #890, #899,
478517
#890
479518
- fix serialisation of '00:00:00' time #968, #967
480519
- Allow to set minVersion ssl option #961, #960
481-
- Fix a MaxListenersExceededWarning with stream
520+
- Fix a MaxListenersExceededWarning with stream
482521
local infile #965
483522

484523
1.6.5 (08/02/2019)
@@ -489,7 +528,7 @@
489528
- fix(debug): remove usage of callee #882
490529

491530
1.6.4 (08/11/2018)
492-
- revert changes breaking node v4 and add v4 to
531+
- revert changes breaking node v4 and add v4 to
493532
build matrix #872, #873
494533

495534
1.6.3 (06/10/2018)
@@ -509,7 +548,7 @@
509548
- Fixed `PromiseConnection.ping()` ignoring errors #813
510549
- Added a uri parameter to the connection config #815
511550
- Added a `.promise()` method shortcut on Pool,
512-
Connection and PoolConnection #810
551+
Connection and PoolConnection #810
513552
- Added more functions from node-mysql:
514553
`createQuery`, `raw`, `escape`, `escapeId`,
515554
`format` #799
@@ -525,7 +564,7 @@
525564
- use strich lru-cache version #751
526565
- bump sqlstring to 2.3.1
527566
- remove noAssert flag from Buffer functions #748
528-
567+
529568
1.5.2 (06/02/2018)
530569
- perf: Store Compiled Packet Parsers in a global
531570
cache #722, #723
@@ -545,7 +584,7 @@
545584
1.5.0 (13/11/2017)
546585
- Added sqlMessage to Error callback object #665
547586
- Normalized sqlState to a string of 5 chars #667
548-
as Mysql specifies it
587+
as Mysql specifies it
549588
- Remove destroyed promise pool connections from
550589
pool #674, #672
551590
- Expose escape & format methods on connection pool #669, #663

Contributing.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Contributions are always welcomed. You can help **MySQL2** community in various
1616
- Performance improvements
1717
- Add Features
1818

19+
---
20+
1921
## Security Issues
2022

2123
Please contact project maintainers privately before opening a security issue on Github. It will allow us to fix the issue before attackers know about it.
@@ -24,18 +26,22 @@ Please contact project maintainers privately before opening a security issue on
2426

2527
- Andrey Sidorov, [email protected]
2628

29+
---
30+
2731
## New Features
2832

2933
It's better to discuss an API before actually start implementing it. You can open an issue on Github. We can discuss design of API and implementation ideas.
3034

35+
---
36+
3137
## Development
3238

3339
We assume you already have these tools installed on your system:
3440

3541
- MySQL Server
3642
- Node.JS
3743

38-
As **MySQL2** is purely JS based you can develop it on Linux, Mac or Windows. Please follow these steps
44+
As **MySQL2** is purely JS based, you can develop it on Linux, Mac or Windows. Please follow these steps
3945

4046
```bash
4147
# clone node-mysql2
@@ -47,6 +53,40 @@ cd /path/to/node-mysql2
4753
npm install
4854
```
4955

56+
---
57+
58+
### Commits and Pull Request Titles
59+
60+
To ensure a clean commit history pattern, please use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format.
61+
62+
Prefixes that will trigger a new release version:
63+
64+
- `fix:` for patches, e.g., bug fixes that result in a patch version release.
65+
- `feat:` for new features, e.g., additions that result in a minor version release.
66+
67+
Examples:
68+
69+
- `fix: message`
70+
- `feat: message`
71+
- `docs: message`
72+
- `fix(module): message`
73+
- `feat(module): message`
74+
- etc.
75+
76+
---
77+
78+
### Including Tests
79+
80+
#### Fixes
81+
82+
Where possible, provide an error test case that your fix covers.
83+
84+
#### Features
85+
86+
Please ensure test cases to cover your features.
87+
88+
---
89+
5090
### Running Tests
5191

5292
Running tests requires MySQL server and an empty database. You can run `bash` command given below to create `test` database
@@ -77,3 +117,12 @@ FILTER='test-timestamp' npm run test
77117
# or
78118
FILTER='timeout' npm run test
79119
```
120+
121+
> [!Tip]
122+
> You can also run a single test by performing `node ./test/path-to-test-file`.
123+
124+
For testing **coverage**:
125+
126+
```bash
127+
npm run coverage-test
128+
```

codecov.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 89%
6+
threshold: 2%

0 commit comments

Comments
 (0)