From 263c0ccfba8133ac06b88c8530a4ee950056d60a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 11 Apr 2023 11:32:21 +0200 Subject: [PATCH] refs #5541 Date null workaround --- mylogger.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mylogger.js b/mylogger.js index b9e833d..9454caa 100644 --- a/mylogger.js +++ b/mylogger.js @@ -716,8 +716,16 @@ function equals(a, b) { if (a == null || b == null || type !== typeof b) return false; if (type === 'object' && a.constructor === b.constructor) { - if (a instanceof Date) - return a.getTime() === b.getTime(); + if (a instanceof Date) { + // FIXME: zongji creates invalid dates for NULL DATE + // Error is somewhere here: zongji/lib/rows_event.js:129 + let aTime = a.getTime(); + if (isNaN(aTime)) aTime = null; + let bTime = b.getTime(); + if (isNaN(bTime)) bTime = null; + + return aTime === bTime; + } } return false; }