[PDI-12892] 5.2 backport: Fix overflow error on int/date compare