liberapay.com
liberapay.com copied to clipboard
Sorting mixed-currency amounts in SQL produces wrong result
Our comparison functions raise an error when currencies don't match, but postgres appears to fall back to comparing the underlying tuples, so we end up with $11 being sorted higher than €10.
Now that we handle 33 currencies, including quite a few with exchange rates of a much greater amplitude than EUR↔USD, this bug is going to become more problematic.
Is this the reason for the mis-sort on /explore/individuals? Yen are much smaller than EUR.
Yep.
I was unable to fix the sorting bug so I worked around it instead.
unblocked