mysql2 3.23.4 → 3.23.5-canary.5bf7bda
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/packets/packet.js +3 -2
- package/package.json +1 -1
package/lib/packets/packet.js
CHANGED
|
@@ -11,6 +11,7 @@ const Long = require('long');
|
|
|
11
11
|
const StringParser = require('../parsers/string.js');
|
|
12
12
|
const Types = require('../constants/types.js');
|
|
13
13
|
const INVALID_DATE = new Date(NaN);
|
|
14
|
+
const ZERO_DATE = '0000-00-00';
|
|
14
15
|
|
|
15
16
|
// this is nearly duplicate of previous function so generated code is not slower
|
|
16
17
|
// due to "if (dateStrings)" branching
|
|
@@ -317,7 +318,7 @@ class Packet {
|
|
|
317
318
|
return new Date(y, m - 1, d, H, M, S, ms);
|
|
318
319
|
}
|
|
319
320
|
let str = this.readDateTimeString(6, 'T', null);
|
|
320
|
-
if (
|
|
321
|
+
if (str.startsWith(ZERO_DATE)) {
|
|
321
322
|
return INVALID_DATE;
|
|
322
323
|
}
|
|
323
324
|
if (str.length === 10) {
|
|
@@ -335,7 +336,7 @@ class Packet {
|
|
|
335
336
|
let M = 0;
|
|
336
337
|
let S = 0;
|
|
337
338
|
let ms = 0;
|
|
338
|
-
let str;
|
|
339
|
+
let str = ZERO_DATE;
|
|
339
340
|
if (length > 3) {
|
|
340
341
|
y = this.readInt16();
|
|
341
342
|
m = this.readInt8();
|
package/package.json
CHANGED