Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting mixed-currency amounts in SQL produces wrong result #980

Open
Changaco opened this issue Feb 15, 2018 · 5 comments
Open

Sorting mixed-currency amounts in SQL produces wrong result #980

Changaco opened this issue Feb 15, 2018 · 5 comments
Labels
blocked issues that can't be fixed yet bug malfunctions which should be corrected as soon as possible

Comments

@Changaco
Copy link
Member

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.

@Changaco Changaco added the bug malfunctions which should be corrected as soon as possible label Feb 15, 2018
@Changaco Changaco changed the title SQL sort of mixed-currency amounts is wrong Sorting mixed-currency amounts in SQL produces wrong result Feb 15, 2018
@Changaco
Copy link
Member Author

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.

@mattbk
Copy link
Contributor

mattbk commented Feb 12, 2019

Is this the reason for the mis-sort on /explore/individuals? Yen are much smaller than EUR.

image

@Changaco
Copy link
Member Author

Yep.

@Changaco Changaco self-assigned this Feb 12, 2019
Changaco added a commit that referenced this issue Feb 12, 2019
@Changaco
Copy link
Member Author

I was unable to fix the sorting bug so I worked around it instead.

@Changaco Changaco removed their assignment Feb 12, 2019
@Changaco Changaco added the blocked issues that can't be fixed yet label May 4, 2019
@ayeshasiddika9196
Copy link

unblocked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked issues that can't be fixed yet bug malfunctions which should be corrected as soon as possible
Development

No branches or pull requests

3 participants