Pull.
J'ai juste update le cutie.js, CONNARD Ah oui, j'ai aussi add le info.js, qui est merdique d'ailleurs
This commit is contained in:
2
node_modules/mysql2/lib/base/connection.js
generated
vendored
2
node_modules/mysql2/lib/base/connection.js
generated
vendored
@@ -392,7 +392,7 @@ class BaseConnection extends EventEmitter {
|
||||
secureSocket.on('data', (data) => {
|
||||
this.packetParser.execute(data);
|
||||
});
|
||||
this.write = (buffer) => secureSocket.write(buffer);
|
||||
this.stream = secureSocket;
|
||||
}
|
||||
|
||||
protocolError(message, code) {
|
||||
|
||||
6
node_modules/mysql2/lib/base/pool.js
generated
vendored
6
node_modules/mysql2/lib/base/pool.js
generated
vendored
@@ -200,7 +200,11 @@ class BasePool extends EventEmitter {
|
||||
Date.now() - this._freeConnections.get(0).lastActiveTime >
|
||||
this.config.idleTimeout)
|
||||
) {
|
||||
this._freeConnections.get(0).destroy();
|
||||
if (this.config.connectionConfig.gracefulEnd) {
|
||||
this._freeConnections.get(0).end();
|
||||
} else {
|
||||
this._freeConnections.get(0).destroy();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
this._removeIdleTimeoutConnections();
|
||||
|
||||
7
node_modules/mysql2/lib/base/pool_connection.js
generated
vendored
7
node_modules/mysql2/lib/base/pool_connection.js
generated
vendored
@@ -30,6 +30,13 @@ class BasePoolConnection extends BaseConnection {
|
||||
}
|
||||
|
||||
end() {
|
||||
if (this.config.gracefulEnd) {
|
||||
this._removeFromPool();
|
||||
super.end();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const err = new Error(
|
||||
'Calling conn.end() to release a pooled connection is ' +
|
||||
'deprecated. In next version calling conn.end() will be ' +
|
||||
|
||||
77
node_modules/mysql2/lib/commands/query.js
generated
vendored
77
node_modules/mysql2/lib/commands/query.js
generated
vendored
@@ -271,30 +271,67 @@ class Query extends Command {
|
||||
}
|
||||
|
||||
stream(options) {
|
||||
options = options || {};
|
||||
options = options || Object.create(null);
|
||||
options.objectMode = true;
|
||||
const stream = new Readable(options);
|
||||
stream._read = () => {
|
||||
this._connection && this._connection.resume();
|
||||
};
|
||||
this.on('result', (row, resultSetIndex) => {
|
||||
if (!stream.push(row)) {
|
||||
this._connection.pause();
|
||||
|
||||
const stream = new Readable({
|
||||
...options,
|
||||
emitClose: true,
|
||||
autoDestroy: true,
|
||||
read: () => {
|
||||
this._connection && this._connection.resume();
|
||||
},
|
||||
});
|
||||
|
||||
// Prevent a breaking change for users that rely on `end` event
|
||||
stream.once('close', () => {
|
||||
if (!stream.readableEnded) {
|
||||
stream.emit('end');
|
||||
}
|
||||
stream.emit('result', row, resultSetIndex); // replicate old emitter
|
||||
});
|
||||
this.on('error', (err) => {
|
||||
stream.emit('error', err); // Pass on any errors
|
||||
});
|
||||
this.on('end', () => {
|
||||
stream.push(null); // pushing null, indicating EOF
|
||||
});
|
||||
this.on('fields', (fields) => {
|
||||
|
||||
const onResult = (row, index) => {
|
||||
if (stream.destroyed) return;
|
||||
|
||||
if (!stream.push(row)) {
|
||||
this._connection && this._connection.pause();
|
||||
}
|
||||
|
||||
stream.emit('result', row, index); // replicate old emitter
|
||||
};
|
||||
|
||||
const onFields = (fields) => {
|
||||
if (stream.destroyed) return;
|
||||
|
||||
stream.emit('fields', fields); // replicate old emitter
|
||||
});
|
||||
stream.on('end', () => {
|
||||
stream.emit('close');
|
||||
});
|
||||
};
|
||||
|
||||
const onEnd = () => {
|
||||
if (stream.destroyed) return;
|
||||
|
||||
stream.push(null); // pushing null, indicating EOF
|
||||
};
|
||||
|
||||
const onError = (err) => {
|
||||
stream.destroy(err);
|
||||
};
|
||||
|
||||
stream._destroy = (err, cb) => {
|
||||
this._connection && this._connection.resume();
|
||||
|
||||
this.removeListener('result', onResult);
|
||||
this.removeListener('fields', onFields);
|
||||
this.removeListener('end', onEnd);
|
||||
this.removeListener('error', onError);
|
||||
|
||||
cb(err); // Pass on any errors
|
||||
};
|
||||
|
||||
this.on('result', onResult);
|
||||
this.on('fields', onFields);
|
||||
this.on('end', onEnd);
|
||||
this.on('error', onError);
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
2
node_modules/mysql2/lib/connection_config.js
generated
vendored
2
node_modules/mysql2/lib/connection_config.js
generated
vendored
@@ -68,6 +68,7 @@ const validOptions = {
|
||||
queueLimit: 1,
|
||||
waitForConnections: 1,
|
||||
jsonStrings: 1,
|
||||
gracefulEnd: 1,
|
||||
};
|
||||
|
||||
class ConnectionConfig {
|
||||
@@ -190,6 +191,7 @@ class ConnectionConfig {
|
||||
};
|
||||
this.maxPreparedStatements = options.maxPreparedStatements || 16000;
|
||||
this.jsonStrings = options.jsonStrings || false;
|
||||
this.gracefulEnd = options.gracefulEnd || false;
|
||||
}
|
||||
|
||||
static mergeFlags(default_flags, user_flags) {
|
||||
|
||||
4
node_modules/mysql2/package.json
generated
vendored
4
node_modules/mysql2/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mysql2",
|
||||
"version": "3.14.3",
|
||||
"version": "3.15.1",
|
||||
"description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
|
||||
"main": "index.js",
|
||||
"typings": "typings/mysql/index",
|
||||
@@ -49,7 +49,7 @@
|
||||
"aws-ssl-profiles": "^1.1.1",
|
||||
"denque": "^2.1.0",
|
||||
"generate-function": "^2.3.1",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"long": "^5.2.1",
|
||||
"lru.min": "^1.0.0",
|
||||
"named-placeholders": "^1.1.3",
|
||||
|
||||
2
node_modules/mysql2/typings/mysql/lib/Connection.d.ts
generated
vendored
2
node_modules/mysql2/typings/mysql/lib/Connection.d.ts
generated
vendored
@@ -335,6 +335,8 @@ export interface ConnectionOptions {
|
||||
* (Default: false)
|
||||
*/
|
||||
jsonStrings?: boolean;
|
||||
|
||||
gracefulEnd?: boolean;
|
||||
}
|
||||
|
||||
declare class Connection extends QueryableBase(ExecutableBase(EventEmitter)) {
|
||||
|
||||
2
node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
generated
vendored
2
node_modules/mysql2/typings/mysql/lib/PoolCluster.d.ts
generated
vendored
@@ -54,7 +54,7 @@ declare class PoolCluster extends EventEmitter {
|
||||
|
||||
remove(pattern: string): void;
|
||||
|
||||
end(): void;
|
||||
end(callback?: (err: NodeJS.ErrnoException | null) => void): void;
|
||||
|
||||
getConnection(
|
||||
callback: (
|
||||
|
||||
4
node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts
generated
vendored
4
node_modules/mysql2/typings/mysql/lib/protocol/sequences/Query.d.ts
generated
vendored
@@ -92,9 +92,9 @@ export interface StreamOptions {
|
||||
highWaterMark?: number;
|
||||
|
||||
/**
|
||||
* The object mode of the stream (Default: true)
|
||||
* The object mode of the stream is always set to `true`
|
||||
*/
|
||||
objectMode?: any;
|
||||
objectMode?: true;
|
||||
}
|
||||
|
||||
export interface QueryError extends NodeJS.ErrnoException {
|
||||
|
||||
Reference in New Issue
Block a user