refs #5541 Date null workaround
gitea/mylogger/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-04-11 11:32:21 +02:00
parent 17a0f40fcd
commit 263c0ccfba
1 changed files with 10 additions and 2 deletions

View File

@ -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;
}