mysql2 3.10.2 → 3.11.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/lib/constants/ssl_profiles.js +7 -2882
- package/lib/constants/types.js +1 -0
- package/lib/packets/packet.js +10 -0
- package/lib/parsers/binary_parser.js +2 -0
- package/lib/parsers/text_parser.js +2 -0
- package/package.json +3 -2
- package/typings/mysql/lib/constants/Types.d.ts +2 -0
- package/typings/mysql/lib/parsers/typeCast.d.ts +1 -0
package/lib/constants/types.js
CHANGED
|
@@ -51,6 +51,7 @@ module.exports.YEAR = 0x0d; // aka YEAR, 1 byte (don't ask)
|
|
|
51
51
|
module.exports.NEWDATE = 0x0e; // aka ?
|
|
52
52
|
module.exports.VARCHAR = 0x0f; // aka VARCHAR (?)
|
|
53
53
|
module.exports.BIT = 0x10; // aka BIT, 1-8 byte
|
|
54
|
+
module.exports.VECTOR = 0xf2;
|
|
54
55
|
module.exports.JSON = 0xf5;
|
|
55
56
|
module.exports.NEWDECIMAL = 0xf6; // aka DECIMAL
|
|
56
57
|
module.exports.ENUM = 0xf7; // aka ENUM
|
package/lib/packets/packet.js
CHANGED
|
@@ -608,6 +608,16 @@ class Packet {
|
|
|
608
608
|
return parseGeometry();
|
|
609
609
|
}
|
|
610
610
|
|
|
611
|
+
parseVector() {
|
|
612
|
+
const bufLen = this.readLengthCodedNumber();
|
|
613
|
+
const vectorEnd = this.offset + bufLen;
|
|
614
|
+
const result = [];
|
|
615
|
+
while (this.offset < vectorEnd && this.offset < this.end) {
|
|
616
|
+
result.push(this.readFloat());
|
|
617
|
+
}
|
|
618
|
+
return result;
|
|
619
|
+
}
|
|
620
|
+
|
|
611
621
|
parseDate(timezone) {
|
|
612
622
|
const strLen = this.readLengthCodedNumber();
|
|
613
623
|
if (strLen === null) {
|
|
@@ -55,6 +55,8 @@ function readCodeFor(field, config, options, fieldNum) {
|
|
|
55
55
|
return 'packet.readLengthCodedString("ascii");';
|
|
56
56
|
case Types.GEOMETRY:
|
|
57
57
|
return 'packet.parseGeometryValue();';
|
|
58
|
+
case Types.VECTOR:
|
|
59
|
+
return 'packet.parseVector()';
|
|
58
60
|
case Types.JSON:
|
|
59
61
|
// Since for JSON columns mysql always returns charset 63 (BINARY),
|
|
60
62
|
// we have to handle it according to JSON specs and use "utf8",
|
|
@@ -59,6 +59,8 @@ function readCodeFor(type, charset, encodingExpr, config, options) {
|
|
|
59
59
|
return 'packet.readLengthCodedString("ascii")';
|
|
60
60
|
case Types.GEOMETRY:
|
|
61
61
|
return 'packet.parseGeometryValue()';
|
|
62
|
+
case Types.VECTOR:
|
|
63
|
+
return 'packet.parseVector()';
|
|
62
64
|
case Types.JSON:
|
|
63
65
|
// Since for JSON columns mysql always returns charset 63 (BINARY),
|
|
64
66
|
// we have to handle it according to JSON specs and use "utf8",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mysql2",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
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",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"author": "Andrey Sidorov <andrey.sidorov@gmail.com>",
|
|
59
59
|
"license": "MIT",
|
|
60
60
|
"dependencies": {
|
|
61
|
+
"aws-ssl-profiles": "^1.1.1",
|
|
61
62
|
"denque": "^2.1.0",
|
|
62
63
|
"generate-function": "^2.3.1",
|
|
63
64
|
"iconv-lite": "^0.6.3",
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
"eslint-plugin-async-await": "0.0.0",
|
|
81
82
|
"eslint-plugin-markdown": "^5.0.0",
|
|
82
83
|
"lint-staged": "^15.0.1",
|
|
83
|
-
"poku": "^
|
|
84
|
+
"poku": "^2.0.0",
|
|
84
85
|
"portfinder": "^1.0.28",
|
|
85
86
|
"prettier": "^3.0.0",
|
|
86
87
|
"progress": "^2.0.3",
|
|
@@ -16,6 +16,7 @@ interface Types {
|
|
|
16
16
|
0x0e: string;
|
|
17
17
|
0x0f: string;
|
|
18
18
|
0x10: string;
|
|
19
|
+
0xf2: string;
|
|
19
20
|
0xf5: string;
|
|
20
21
|
0xf6: string;
|
|
21
22
|
0xf7: string;
|
|
@@ -45,6 +46,7 @@ interface Types {
|
|
|
45
46
|
NEWDATE: number;
|
|
46
47
|
VARCHAR: number;
|
|
47
48
|
BIT: number;
|
|
49
|
+
VECTOR: number;
|
|
48
50
|
JSON: number;
|
|
49
51
|
NEWDECIMAL: number;
|
|
50
52
|
ENUM: number;
|