chore: patch mysql2

This commit is contained in:
Linden committed 2023-03-07 15:44:14 +11:00
1 parent b772cd2bd2
commit be8580396c
1 file changed
+26 -30
@@ -1,10 +1,10 @@
# generated by patch-package 6.4.14 # generated by patch-package 6.4.14
# #
# declared package: # declared package:
# mysql2: ^3.0.1 # mysql2: ^3.2.0
# #
diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts diff --git a/node_modules/mysql2/index.d.ts b/node_modules/mysql2/index.d.ts
index 31195a1..bc1adaa 100644 index ec138d2..968c32f 100644
--- a/node_modules/mysql2/index.d.ts --- a/node_modules/mysql2/index.d.ts
+++ b/node_modules/mysql2/index.d.ts +++ b/node_modules/mysql2/index.d.ts
@@ -172,7 +172,6 @@ export interface ConnectionOptions extends mysql.ConnectionOptions { @@ -172,7 +172,6 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
@@ -62,7 +62,7 @@ index e51da3c..d9218d3 100644
} }
} }
diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js diff --git a/node_modules/mysql2/lib/connection.js b/node_modules/mysql2/lib/connection.js
index 7e8a1a0..cc749e0 100644 index 790226a..732be9d 100644
--- a/node_modules/mysql2/lib/connection.js --- a/node_modules/mysql2/lib/connection.js
+++ b/node_modules/mysql2/lib/connection.js +++ b/node_modules/mysql2/lib/connection.js
@@ -32,8 +32,6 @@ const CharsetToEncoding = require('./constants/charset_encodings.js'); @@ -32,8 +32,6 @@ const CharsetToEncoding = require('./constants/charset_encodings.js');
@@ -74,7 +74,7 @@ index 7e8a1a0..cc749e0 100644
class Connection extends EventEmitter { class Connection extends EventEmitter {
constructor(opts) { constructor(opts) {
super(); super();
@@ -526,7 +524,7 @@ class Connection extends EventEmitter { @@ -528,7 +526,7 @@ class Connection extends EventEmitter {
sql: sql, sql: sql,
values: values values: values
}; };
@@ -83,7 +83,7 @@ index 7e8a1a0..cc749e0 100644
return SqlString.format( return SqlString.format(
opts.sql, opts.sql,
opts.values, opts.values,
@@ -547,23 +545,6 @@ class Connection extends EventEmitter { @@ -549,23 +547,6 @@ class Connection extends EventEmitter {
return SqlString.raw(sql); return SqlString.raw(sql);
} }
@@ -107,7 +107,7 @@ index 7e8a1a0..cc749e0 100644
query(sql, values, cb) { query(sql, values, cb) {
let cmdQuery; let cmdQuery;
if (sql.constructor === Commands.Query) { if (sql.constructor === Commands.Query) {
@@ -571,7 +552,7 @@ class Connection extends EventEmitter { @@ -573,7 +554,7 @@ class Connection extends EventEmitter {
} else { } else {
cmdQuery = Connection.createQuery(sql, values, cb, this.config); cmdQuery = Connection.createQuery(sql, values, cb, this.config);
} }
@@ -116,7 +116,7 @@ index 7e8a1a0..cc749e0 100644
const rawSql = this.format(cmdQuery.sql, cmdQuery.values !== undefined ? cmdQuery.values : []); const rawSql = this.format(cmdQuery.sql, cmdQuery.values !== undefined ? cmdQuery.values : []);
cmdQuery.sql = rawSql; cmdQuery.sql = rawSql;
return this.addCommand(cmdQuery); return this.addCommand(cmdQuery);
@@ -639,26 +620,12 @@ class Connection extends EventEmitter { @@ -641,26 +622,12 @@ class Connection extends EventEmitter {
options.sql = sql; options.sql = sql;
options.values = values; options.values = values;
} }
@@ -146,10 +146,10 @@ index 7e8a1a0..cc749e0 100644
if (typeof val === 'function') { if (typeof val === 'function') {
throw new TypeError( throw new TypeError(
diff --git a/node_modules/mysql2/lib/connection_config.js b/node_modules/mysql2/lib/connection_config.js diff --git a/node_modules/mysql2/lib/connection_config.js b/node_modules/mysql2/lib/connection_config.js
index 98fa1d3..2189e33 100644 index edb7fcf..de5b51f 100644
--- a/node_modules/mysql2/lib/connection_config.js --- a/node_modules/mysql2/lib/connection_config.js
+++ b/node_modules/mysql2/lib/connection_config.js +++ b/node_modules/mysql2/lib/connection_config.js
@@ -204,7 +204,6 @@ class ConnectionConfig { @@ -213,7 +213,6 @@ class ConnectionConfig {
'LONG_PASSWORD', 'LONG_PASSWORD',
'FOUND_ROWS', 'FOUND_ROWS',
'LONG_FLAG', 'LONG_FLAG',
@@ -157,26 +157,21 @@ index 98fa1d3..2189e33 100644
'ODBC', 'ODBC',
'LOCAL_FILES', 'LOCAL_FILES',
'IGNORE_SPACE', 'IGNORE_SPACE',
@@ -217,15 +216,14 @@ class ConnectionConfig { @@ -227,9 +226,12 @@ class ConnectionConfig {
'TRANSACTIONS', 'SESSION_TRACK',
'SESSION_TRACK' 'CONNECT_ATTRS'
]; ];
- if (options && options.multipleStatements) { - if (options && options.multipleStatements) {
- defaultFlags.push('MULTI_STATEMENTS'); - defaultFlags.push('MULTI_STATEMENTS');
+
+ if (options) { + if (options) {
+ if (options.multipleStatements) defaultFlags.push('MULTI_STATEMENTS'); + if (options.multipleStatements) defaultFlags.push('MULTI_STATEMENTS');
+ if (options.database) defaultFlags.push('CONNECT_WITH_DB'); + if (options.database) defaultFlags.push('CONNECT_WITH_DB');
+ if (options.connectAttributes) defaultFlags.push('CONNECT_ATTRS')
} }
+
defaultFlags.push('PLUGIN_AUTH'); defaultFlags.push('PLUGIN_AUTH');
defaultFlags.push('PLUGIN_AUTH_LENENC_CLIENT_DATA'); defaultFlags.push('PLUGIN_AUTH_LENENC_CLIENT_DATA');
- if (options && options.connectAttributes) {
- defaultFlags.push('CONNECT_ATTRS');
- }
return defaultFlags;
}
diff --git a/node_modules/mysql2/lib/packets/execute.js b/node_modules/mysql2/lib/packets/execute.js diff --git a/node_modules/mysql2/lib/packets/execute.js b/node_modules/mysql2/lib/packets/execute.js
index daf1df9..4ed2744 100644 index daf1df9..4ed2744 100644
--- a/node_modules/mysql2/lib/packets/execute.js --- a/node_modules/mysql2/lib/packets/execute.js
@@ -219,20 +214,21 @@ index 49a128c..7eafb2c 100644
if (field.columnType === Types.JSON && encoding === field.encoding) { if (field.columnType === Types.JSON && encoding === field.encoding) {
// Since for JSON columns mysql always returns charset 63 (BINARY), // Since for JSON columns mysql always returns charset 63 (BINARY),
diff --git a/node_modules/mysql2/lib/pool.js b/node_modules/mysql2/lib/pool.js diff --git a/node_modules/mysql2/lib/pool.js b/node_modules/mysql2/lib/pool.js
index 6a7ab48..0ebd1d2 100644 index db54a7a..f104061 100644
--- a/node_modules/mysql2/lib/pool.js --- a/node_modules/mysql2/lib/pool.js
+++ b/node_modules/mysql2/lib/pool.js +++ b/node_modules/mysql2/lib/pool.js
@@ -151,7 +151,7 @@ class Pool extends EventEmitter { @@ -155,7 +155,8 @@ class Pool extends EventEmitter {
}); });
} catch (e) { } catch (e) {
conn.release(); conn.release();
- throw e; - throw e;
+ // throw e;
+ return cb(e); + return cb(e);
} }
}); });
return cmdQuery; return cmdQuery;
diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts diff --git a/node_modules/mysql2/promise.d.ts b/node_modules/mysql2/promise.d.ts
index b5441ab..9c1b413 100644 index b5441ab..c4ddfbe 100644
--- a/node_modules/mysql2/promise.d.ts --- a/node_modules/mysql2/promise.d.ts
+++ b/node_modules/mysql2/promise.d.ts +++ b/node_modules/mysql2/promise.d.ts
@@ -26,41 +26,15 @@ export interface Connection extends EventEmitter { @@ -26,41 +26,15 @@ export interface Connection extends EventEmitter {
@@ -253,7 +249,7 @@ index b5441ab..9c1b413 100644
- values: any | any[] | { [param: string]: any } - values: any | any[] | { [param: string]: any }
- ): Promise<[T, FieldPacket[]]>; - ): Promise<[T, FieldPacket[]]>;
+ sql_or_options: string | QueryOptions, + sql_or_options: string | QueryOptions,
+ values?: any | any[] | { [param: string]: any }, + values?: any | any[] | { [param: string]: any }
+ ): Promise<[T, FieldPacket[], number]>; + ): Promise<[T, FieldPacket[], number]>;
execute< execute<
@@ -278,7 +274,7 @@ index b5441ab..9c1b413 100644
- options: QueryOptions, - options: QueryOptions,
- values: any | any[] | { [param: string]: any } - values: any | any[] | { [param: string]: any }
+ sql_or_options: string | QueryOptions, + sql_or_options: string | QueryOptions,
+ values?: any | any[] | { [param: string]: any }, + values?: any | any[] | { [param: string]: any }
): Promise<[T, FieldPacket[]]>; ): Promise<[T, FieldPacket[]]>;
prepare(options: string | QueryOptions): Promise<PreparedStatementInfo>; prepare(options: string | QueryOptions): Promise<PreparedStatementInfo>;
@@ -300,7 +296,7 @@ index b5441ab..9c1b413 100644
- values: any | any[] | { [param: string]: any } - values: any | any[] | { [param: string]: any }
- ): Promise<[T, FieldPacket[]]>; - ): Promise<[T, FieldPacket[]]>;
+ sql_or_options: string | QueryOptions, + sql_or_options: string | QueryOptions,
+ values?: any | any[] | { [param: string]: any }, + values?: any | any[] | { [param: string]: any }
+ ): Promise<[T, FieldPacket[], number]>; + ): Promise<[T, FieldPacket[], number]>;
execute< execute<
@@ -325,7 +321,7 @@ index b5441ab..9c1b413 100644
- options: QueryOptions, - options: QueryOptions,
- values: any | any[] | { [param: string]: any } - values: any | any[] | { [param: string]: any }
+ sql_or_options: string | QueryOptions, + sql_or_options: string | QueryOptions,
+ values?: any | any[] | { [param: string]: any }, + values?: any | any[] | { [param: string]: any }
): Promise<[T, FieldPacket[]]>; ): Promise<[T, FieldPacket[]]>;
getConnection(): Promise<PoolConnection>; getConnection(): Promise<PoolConnection>;
@@ -352,10 +348,10 @@ index a264e77..20c1b68 100644
}; };
} }
diff --git a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts diff --git a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
index 12204cf..b5899ef 100644 index 08a51b4..49ff4af 100644
--- a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts --- a/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
+++ b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts +++ b/node_modules/mysql2/typings/mysql/lib/Connection.d.ts
@@ -254,7 +254,7 @@ declare class Connection extends EventEmitter { @@ -259,7 +259,7 @@ declare class Connection extends EventEmitter {
changeUser(options: Connection.ConnectionOptions, callback?: (err: Query.QueryError | null) => void): void; changeUser(options: Connection.ConnectionOptions, callback?: (err: Query.QueryError | null) => void): void;
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query; query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;
@@ -365,10 +361,10 @@ index 12204cf..b5899ef 100644
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(options: Query.QueryOptions, values: any | any[] | { [param: string]: any }, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query; query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(options: Query.QueryOptions, values: any | any[] | { [param: string]: any }, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;
diff --git a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts diff --git a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
index bebe039..d6fed9f 100644 index 4d7ac68..ffeb667 100644
--- a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts --- a/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
+++ b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts +++ b/node_modules/mysql2/typings/mysql/lib/Pool.d.ts
@@ -52,7 +52,7 @@ declare class Pool extends EventEmitter { @@ -62,7 +62,7 @@ declare class Pool extends EventEmitter {
getConnection(callback: (err: NodeJS.ErrnoException | null, connection: PoolConnection) => any): void; getConnection(callback: (err: NodeJS.ErrnoException | null, connection: PoolConnection) => any): void;
query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query; query<T extends RowDataPacket[][] | RowDataPacket[] | OkPacket | OkPacket[] | ResultSetHeader>(sql: string, callback?: (err: Query.QueryError | null, result: T, fields: FieldPacket[]) => any): Query;