mysql2 3.11.0 → 3.11.1

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/lib/pool.js CHANGED
@@ -200,9 +200,10 @@ class Pool extends EventEmitter {
200
200
  this._removeIdleTimeoutConnectionsTimer = setTimeout(() => {
201
201
  try {
202
202
  while (
203
- this._freeConnections.length > this.config.maxIdle &&
204
- Date.now() - this._freeConnections.get(0).lastActiveTime >
205
- this.config.idleTimeout
203
+ this._freeConnections.length > this.config.maxIdle ||
204
+ (this._freeConnections.length > 0 &&
205
+ Date.now() - this._freeConnections.get(0).lastActiveTime >
206
+ this.config.idleTimeout)
206
207
  ) {
207
208
  this._freeConnections.get(0).destroy();
208
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mysql2",
3
- "version": "3.11.0",
3
+ "version": "3.11.1",
4
4
  "description": "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",
@@ -69,7 +69,7 @@
69
69
  "sqlstring": "^2.3.2"
70
70
  },
71
71
  "devDependencies": {
72
- "@types/node": "^20.0.0",
72
+ "@types/node": "^22.0.0",
73
73
  "@typescript-eslint/eslint-plugin": "^5.42.1",
74
74
  "@typescript-eslint/parser": "^5.42.1",
75
75
  "assert-diff": "^3.0.2",
package/promise.js CHANGED
@@ -451,10 +451,10 @@ class PromisePoolCluster extends EventEmitter {
451
451
  inheritEvents(poolCluster, this, ['warn', 'remove']);
452
452
  }
453
453
 
454
- getConnection() {
454
+ getConnection(pattern, selector) {
455
455
  const corePoolCluster = this.poolCluster;
456
456
  return new this.Promise((resolve, reject) => {
457
- corePoolCluster.getConnection((err, coreConnection) => {
457
+ corePoolCluster.getConnection(pattern, selector, (err, coreConnection) => {
458
458
  if (err) {
459
459
  reject(err);
460
460
  } else {