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
SQL: Fix MOD() for long and integer arguments #36599
Conversation
Previously, Math.floorMod was used for integers and longs which has different logic for negative numbers. Also, the priority of data types check was wrong as if one of the args is double the evaluation should be with doubles, then for floats, then longs and finally integers. Fixes: elastic#36364
Pinging @elastic/es-search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
P.S. What's up with removing the throws Exception from the methods?
@costin you get a warning for them in the IDE, since there is no signature requiring this and doesn't change anything in the behaviour of junit. |
Previously, Math.floorMod was used for integers and longs which has different logic for negative numbers. Also, the priority of data types check was wrong as if one of the args is double the evaluation should be with doubles, then for floats, then longs and finally integers. Fixes: #36364
Backported to |
Previously, Math.floorMod was used for integers and longs which has different logic for negative numbers. Also, the priority of data types check was wrong as if one of the args is double the evaluation should be with doubles, then for floats, then longs and finally integers. Fixes: #36364
Backported to |
Previously, Math.floorMod was used for integers and longs
which has different logic for negative numbers. Also, the
priority of data types check was wrong as if one of the args
is double the evaluation should be with doubles, then for floats,
then longs and finally integers.
Fixes: #36364