mysql2 3.10.0 → 3.10.2
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.
|
@@ -102,6 +102,24 @@ function compile(fields, options, config) {
|
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
if (
|
|
106
|
+
[Types.DATETIME, Types.NEWDATE, Types.TIMESTAMP, Types.DATE].includes(
|
|
107
|
+
field.columnType,
|
|
108
|
+
)
|
|
109
|
+
) {
|
|
110
|
+
return packet.readDateTimeString(parseInt(field.decimals, 10));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (field.columnType === Types.TINY) {
|
|
114
|
+
const unsigned = field.flags & FieldFlags.UNSIGNED;
|
|
115
|
+
|
|
116
|
+
return String(unsigned ? packet.readInt8() : packet.readSInt8());
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (field.columnType === Types.TIME) {
|
|
120
|
+
return packet.readTimeString();
|
|
121
|
+
}
|
|
122
|
+
|
|
105
123
|
return packet.readLengthCodedString(encoding);
|
|
106
124
|
},
|
|
107
125
|
buffer: function () {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const LRU = require('lru-cache').default;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
let parserCache = new LRU({
|
|
6
6
|
max: 15000,
|
|
7
7
|
});
|
|
8
8
|
|
|
@@ -51,7 +51,7 @@ function getParser(type, fields, options, config, compiler) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function setMaxCache(max) {
|
|
54
|
-
parserCache
|
|
54
|
+
parserCache = new LRU({ max });
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
function clearCache() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mysql2",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.2",
|
|
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",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@typescript-eslint/parser": "^5.42.1",
|
|
74
74
|
"assert-diff": "^3.0.2",
|
|
75
75
|
"benchmark": "^2.1.4",
|
|
76
|
-
"c8": "^
|
|
76
|
+
"c8": "^10.1.1",
|
|
77
77
|
"error-stack-parser": "^2.0.3",
|
|
78
78
|
"eslint": "^8.27.0",
|
|
79
79
|
"eslint-config-prettier": "^9.0.0",
|