@depup/mysql2 3.19.0-depup.0 → 3.19.1-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,114 +1,25 @@
1
- [npm-image]: https://img.shields.io/npm/v/mysql2.svg
2
- [npm-url]: https://npmjs.com/package/mysql2
3
- [node-version-image]: https://img.shields.io/node/v/mysql2.svg
4
- [node-version-url]: https://nodejs.org/en/download
5
- [downloads-image]: https://img.shields.io/npm/dm/mysql2.svg
6
- [downloads-url]: https://npmjs.com/package/mysql2
7
- [license-url]: https://github.com/sidorares/node-mysql2/blob/master/License
8
- [license-image]: https://img.shields.io/npm/l/mysql2.svg?maxAge=2592000
9
- [node-mysql]: https://github.com/mysqljs/mysql
10
- [mysqljs]: https://github.com/mysqljs
11
- [mysql-native]: https://github.com/sidorares/nodejs-mysql-native
12
- [sidorares]: https://github.com/sidorares
13
- [TooTallNate]: https://gist.github.com/TooTallNate
14
- [starttls.js]: https://gist.github.com/TooTallNate/848444
15
- [node-mariasql]: https://github.com/mscdex/node-mariasql
16
- [contributors]: https://github.com/sidorares/node-mysql2/graphs/contributors
17
- [contributing]: https://github.com/sidorares/node-mysql2/blob/master/Contributing.md
18
- [docs-base]: https://sidorares.github.io/node-mysql2/docs
19
- [docs-base-zh-CN]: https://sidorares.github.io/node-mysql2/zh-CN/docs
20
- [docs-base-pt-BR]: https://sidorares.github.io/node-mysql2/pt-BR/docs
21
- [docs-prepared-statements]: https://sidorares.github.io/node-mysql2/docs/documentation/prepared-statements
22
- [docs-mysql-server]: https://sidorares.github.io/node-mysql2/docs/documentation/mysql-server
23
- [docs-promise-wrapper]: https://sidorares.github.io/node-mysql2/docs/documentation/promise-wrapper
24
- [docs-authentication-switch]: https://sidorares.github.io/node-mysql2/docs/documentation/authentication-switch
25
- [docs-streams]: https://sidorares.github.io/node-mysql2/docs/documentation/extras
26
- [docs-typescript-docs]: https://sidorares.github.io/node-mysql2/docs/documentation/typescript-examples
27
- [docs-qs-pooling]: https://sidorares.github.io/node-mysql2/docs#using-connection-pools
28
- [docs-qs-first-query]: https://sidorares.github.io/node-mysql2/docs#first-query
29
- [docs-qs-using-prepared-statements]: https://sidorares.github.io/node-mysql2/docs#using-prepared-statements
30
- [docs-examples]: https://sidorares.github.io/node-mysql2/docs/examples
31
- [docs-faq]: https://sidorares.github.io/node-mysql2/docs/faq
32
- [docs-documentation]: https://sidorares.github.io/node-mysql2/docs/documentation
33
- [docs-contributing]: https://sidorares.github.io/node-mysql2/docs/contributing/website
34
- [coverage]: https://img.shields.io/codecov/c/github/sidorares/node-mysql2
35
- [coverage-url]: https://app.codecov.io/github/sidorares/node-mysql2
36
- [ci-url]: https://github.com/sidorares/node-mysql2/actions/workflows/ci-coverage.yml?query=branch%3Amaster
37
- [ci-image]: https://img.shields.io/github/actions/workflow/status/sidorares/node-mysql2/ci-coverage.yml?event=push&style=flat&label=CI&branch=master
1
+ # @depup/mysql2
38
2
 
39
- # MySQL2
3
+ > Dependency-bumped version of [mysql2](https://www.npmjs.com/package/mysql2)
40
4
 
41
- [![NPM Version][npm-image]][npm-url]
42
- [![NPM Downloads][downloads-image]][downloads-url]
43
- [![Node.js Version][node-version-image]][node-version-url]
44
- [![GitHub Workflow Status (with event)][ci-image]][ci-url]
45
- [![Codecov][coverage]][coverage-url]
46
- [![License][license-image]][license-url]
47
-
48
- [English][docs-base] | [简体中文][docs-base-zh-CN] | [Português (BR)][docs-base-pt-BR]
49
-
50
- > MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl [much more][docs-documentation].
51
-
52
- **Table of Contents**
53
-
54
- - [History and Why MySQL2](#history-and-why-mysql2)
55
- - [Installation](#installation)
56
- - [Documentation](#documentation)
57
- - [Acknowledgements](#acknowledgements)
58
- - [Contributing](#contributing)
59
-
60
- ## History and Why MySQL2
61
-
62
- MySQL2 project is a continuation of [MySQL-Native][mysql-native]. Protocol parser code was rewritten from scratch and api changed to match popular [Node MySQL][node-mysql]. MySQL2 team is working together with [Node MySQL][node-mysql] team to factor out shared code and move it under [mysqljs][mysqljs] organization.
63
-
64
- MySQL2 is mostly API compatible with [Node MySQL][node-mysql] and supports majority of features. MySQL2 also offers these additional features:
65
-
66
- - Faster / Better Performance
67
- - [Prepared Statements][docs-prepared-statements]
68
- - MySQL Binary Log Protocol
69
- - [MySQL Server][docs-mysql-server]
70
- - Extended support for Encoding and Collation
71
- - [Promise Wrapper][docs-promise-wrapper]
72
- - Compression
73
- - SSL and [Authentication Switch][docs-authentication-switch]
74
- - [Custom Streams][docs-streams]
75
- - [Pooling][docs-qs-pooling]
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
76
7
 
77
8
  ## Installation
78
9
 
79
- MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.
80
-
81
10
  ```bash
82
- npm install --save mysql2
11
+ npm install @depup/mysql2
83
12
  ```
84
13
 
85
- If you are using TypeScript, you will need to install `@types/node`.
86
-
87
- ```bash
88
- npm install --save-dev @types/node
89
- ```
90
-
91
- > For TypeScript documentation and examples, see [here][docs-typescript-docs].
92
-
93
- ## Documentation
94
-
95
- - [Quickstart][docs-base]
96
- - [First Query][docs-qs-first-query], [Using Prepared Statements][docs-qs-using-prepared-statements], [Using Connection Pools][docs-qs-pooling] and more.
97
- - [Documentation][docs-documentation]
98
- - [Examples][docs-examples]
99
- - [FAQ][docs-faq]
100
-
101
- ## Acknowledgements
102
-
103
- - Internal protocol is written by [@sidorares][sidorares] [MySQL-Native][mysql-native].
104
- - Constants, SQL parameters interpolation, Pooling, `ConnectionConfig` class taken from [Node MySQL][node-mysql].
105
- - SSL upgrade code based on [@TooTallNate][TooTallNate] [code][starttls.js].
106
- - Secure connection / compressed connection api flags compatible to [MariaSQL][node-mariasql] client.
107
- - [Contributors][contributors].
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [mysql2](https://www.npmjs.com/package/mysql2) @ 3.19.1 |
17
+ | Processed | 2026-03-09 |
18
+ | Smoke test | passed |
19
+ | Deps updated | 0 |
108
20
 
109
- ## Contributing
21
+ ---
110
22
 
111
- Want to improve something in **MySQL2**?
112
- Please check [Contributing.md][contributing] for detailed instruction on how to get started.
23
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/mysql2
113
24
 
114
- To contribute in **MySQL2 Documentation**, please visit the [Website Contributing Guidelines][docs-contributing] for detailed instruction on how to get started.
25
+ License inherited from the original package.
@@ -277,7 +277,10 @@ class ConnectionConfig {
277
277
  user: decodeURIComponent(parsedUrl.username),
278
278
  password: decodeURIComponent(parsedUrl.password),
279
279
  };
280
- parsedUrl.searchParams.forEach((value, key) => {
280
+ for (const [key, value] of parsedUrl.searchParams) {
281
+ if (key in options) {
282
+ continue;
283
+ }
281
284
  try {
282
285
  // Try to parse this as a JSON expression first
283
286
  options[key] = JSON.parse(value);
@@ -285,7 +288,7 @@ class ConnectionConfig {
285
288
  // Otherwise assume it is a plain string
286
289
  options[key] = value;
287
290
  }
288
- });
291
+ }
289
292
  return options;
290
293
  }
291
294
  }
@@ -406,8 +406,8 @@ class Packet {
406
406
  readNullTerminatedString(encoding) {
407
407
  const start = this.offset;
408
408
  let end = this.offset;
409
- while (this.buffer[end]) {
410
- end = end + 1; // TODO: handle OOB check
409
+ while (end < this.end && this.buffer[end] !== 0x00) {
410
+ end = end + 1;
411
411
  }
412
412
  this.offset = end + 1;
413
413
  return StringParser.decode(this.buffer, encoding, start, end);
@@ -516,16 +516,20 @@ class Packet {
516
516
  return result * sign;
517
517
  }
518
518
 
519
- // copy-paste from https://github.com/mysqljs/mysql/blob/master/lib/protocol/Parser.js
519
+ // adapted from https://github.com/mysqljs/mysql/blob/dc9c152a87ec51a1f647447268917243d2eab1fd/lib/protocol/Parser.js
520
520
  parseGeometryValue() {
521
521
  const buffer = this.readLengthCodedBuffer();
522
522
  let offset = 4;
523
523
  if (buffer === null || !buffer.length) {
524
524
  return null;
525
525
  }
526
+ const bufferLength = buffer.length;
526
527
  function parseGeometry() {
527
- let x, y, i, j, numPoints, line;
528
+ let x, y, i, j, numPoints, numRings, num, line;
528
529
  let result = null;
530
+ if (offset + 5 > bufferLength) {
531
+ return null;
532
+ }
529
533
  const byteOrder = buffer.readUInt8(offset);
530
534
  offset += 1;
531
535
  const wkbType = byteOrder
@@ -534,6 +538,9 @@ class Packet {
534
538
  offset += 4;
535
539
  switch (wkbType) {
536
540
  case 1: // WKBPoint
541
+ if (offset + 16 > bufferLength) {
542
+ return null;
543
+ }
537
544
  x = byteOrder
538
545
  ? buffer.readDoubleLE(offset)
539
546
  : buffer.readDoubleBE(offset);
@@ -545,12 +552,21 @@ class Packet {
545
552
  result = { x: x, y: y };
546
553
  break;
547
554
  case 2: // WKBLineString
555
+ if (offset + 4 > bufferLength) {
556
+ return null;
557
+ }
548
558
  numPoints = byteOrder
549
559
  ? buffer.readUInt32LE(offset)
550
560
  : buffer.readUInt32BE(offset);
551
561
  offset += 4;
562
+ if (numPoints > (bufferLength - offset) / 16) {
563
+ return null;
564
+ }
552
565
  result = [];
553
566
  for (i = numPoints; i > 0; i--) {
567
+ if (offset + 16 > bufferLength) {
568
+ break;
569
+ }
554
570
  x = byteOrder
555
571
  ? buffer.readDoubleLE(offset)
556
572
  : buffer.readDoubleBE(offset);
@@ -563,19 +579,30 @@ class Packet {
563
579
  }
564
580
  break;
565
581
  case 3: // WKBPolygon
566
- // eslint-disable-next-line no-case-declarations
567
- const numRings = byteOrder
582
+ if (offset + 4 > bufferLength) {
583
+ return null;
584
+ }
585
+ numRings = byteOrder
568
586
  ? buffer.readUInt32LE(offset)
569
587
  : buffer.readUInt32BE(offset);
570
588
  offset += 4;
589
+ if (numRings > (bufferLength - offset) / 4) {
590
+ return null;
591
+ }
571
592
  result = [];
572
593
  for (i = numRings; i > 0; i--) {
594
+ if (offset + 4 > bufferLength) {
595
+ break;
596
+ }
573
597
  numPoints = byteOrder
574
598
  ? buffer.readUInt32LE(offset)
575
599
  : buffer.readUInt32BE(offset);
576
600
  offset += 4;
577
601
  line = [];
578
602
  for (j = numPoints; j > 0; j--) {
603
+ if (offset + 16 > bufferLength) {
604
+ break;
605
+ }
579
606
  x = byteOrder
580
607
  ? buffer.readDoubleLE(offset)
581
608
  : buffer.readDoubleBE(offset);
@@ -593,11 +620,16 @@ class Packet {
593
620
  case 5: // WKBMultiLineString
594
621
  case 6: // WKBMultiPolygon
595
622
  case 7: // WKBGeometryCollection
596
- // eslint-disable-next-line no-case-declarations
597
- const num = byteOrder
623
+ if (offset + 4 > bufferLength) {
624
+ return null;
625
+ }
626
+ num = byteOrder
598
627
  ? buffer.readUInt32LE(offset)
599
628
  : buffer.readUInt32BE(offset);
600
629
  offset += 4;
630
+ if (num > (bufferLength - offset) / 9) {
631
+ return null;
632
+ }
601
633
  result = [];
602
634
  for (i = num; i > 0; i--) {
603
635
  result.push(parseGeometry());
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depup/mysql2",
3
- "version": "3.19.0-depup.0",
4
- "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
3
+ "version": "3.19.1-depup.0",
4
+ "description": "[DepUp] fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
5
5
  "main": "index.js",
6
6
  "typings": "typings/mysql/index",
7
7
  "type": "commonjs",
@@ -15,8 +15,8 @@
15
15
  "test:bun:parallel": "bun poku -c=\"poku.config.mjs\" test",
16
16
  "test:bun:global": "cross-env SUITE=global bun poku -c=\"poku.config.mjs\" test/global",
17
17
  "test:deno": "npm run test:deno:parallel && npm run test:deno:global",
18
- "test:deno:parallel": "deno run --allow-read --allow-env --allow-run npm:poku@canary -c=\"poku.config.mjs\" test",
19
- "test:deno:global": "cross-env SUITE=global deno run --allow-read --allow-env --allow-run npm:poku@canary -c=\"poku.config.mjs\" test/global",
18
+ "test:deno:parallel": "deno run --allow-read --allow-env --allow-run npm:poku -c=\"poku.config.mjs\" test",
19
+ "test:deno:global": "cross-env SUITE=global deno run --allow-read --allow-env --allow-run npm:poku -c=\"poku.config.mjs\" test/global",
20
20
  "test:docker:up": "docker compose -f test/docker-compose.yml up --abort-on-container-exit --remove-orphans",
21
21
  "test:docker:down": "docker compose -f test/docker-compose.yml down",
22
22
  "test:docker:node": "npm run test:docker:up -- node && npm run test:docker:down",
@@ -34,6 +34,10 @@
34
34
  },
35
35
  "homepage": "https://sidorares.github.io/node-mysql2/docs",
36
36
  "keywords": [
37
+ "depup",
38
+ "dependency-bumped",
39
+ "updated-deps",
40
+ "mysql2",
37
41
  "mysql",
38
42
  "client",
39
43
  "server"
@@ -87,10 +91,18 @@
87
91
  "eslint-plugin-async-await": "^0.0.0",
88
92
  "eslint-plugin-prettier": "^5.5.5",
89
93
  "globals": "^17.3.0",
90
- "poku": "^3.0.3-canary.8f374795",
94
+ "poku": "^4.0.0",
91
95
  "portfinder": "^1.0.38",
92
96
  "prettier": "^3.8.1",
93
97
  "tsx": "^4.21.0",
94
98
  "typescript": "^5.9.3"
99
+ },
100
+ "depup": {
101
+ "changes": {},
102
+ "depsUpdated": 0,
103
+ "originalPackage": "mysql2",
104
+ "originalVersion": "3.19.1",
105
+ "processedAt": "2026-03-09T20:13:32.895Z",
106
+ "smokeTest": "passed"
95
107
  }
96
108
  }