Issue #2988309 by Krzysztof Domański, Berdir, hchonov: Ensure that all field types return TRUE on equals() for the same values (cherry picked from commit 29e32469)