Two decimal literals:
are considered as non-equal by "=",
but considered as equal for UNION DISTINCT:
Comparison in "=" and comparison in UNION DISTINCT should use the same rules.
The problem most likely happens because we don't support fields with decimal
scale > 30. UNION uses a temporary table and creates a field,
while '=' does not need a field and compares the two numbers directly.
Literals should probably be fixed not to support more than 30 fractional as well.