-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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: negative numbers surrounded by round brackets are not treated as negative #48009
Labels
Comments
Pinging @elastic/es-search (:Search/SQL) |
matriv
added a commit
to matriv/elasticsearch
that referenced
this issue
Oct 16, 2019
Previously when a numeric literal was enclosed in parentheses and then negated, the negation was lost and the number was considered positive, e.g.: `-(5)` was considered as `5` instead of `-5` `- ( (1.28) )` was considered as `1.28` instead of `-1.28` Fixes: elastic#48009
matriv
added a commit
that referenced
this issue
Oct 16, 2019
Previously when a numeric literal was enclosed in parentheses and then negated, the negation was lost and the number was considered positive, e.g.: `-(5)` was considered as `5` instead of `-5` `- ( (1.28) )` was considered as `1.28` instead of `-1.28` Fixes: #48009
matriv
added a commit
that referenced
this issue
Oct 16, 2019
Previously when a numeric literal was enclosed in parentheses and then negated, the negation was lost and the number was considered positive, e.g.: `-(5)` was considered as `5` instead of `-5` `- ( (1.28) )` was considered as `1.28` instead of `-1.28` Fixes: #48009 (cherry picked from commit 4dee4bf)
matriv
added a commit
that referenced
this issue
Oct 16, 2019
Previously when a numeric literal was enclosed in parentheses and then negated, the negation was lost and the number was considered positive, e.g.: `-(5)` was considered as `5` instead of `-5` `- ( (1.28) )` was considered as `1.28` instead of `-1.28` Fixes: #48009 (cherry picked from commit 4dee4bf)
matriv
added a commit
that referenced
this issue
Oct 16, 2019
Previously when a numeric literal was enclosed in parentheses and then negated, the negation was lost and the number was considered positive, e.g.: `-(5)` was considered as `5` instead of `-5` `- ( (1.28) )` was considered as `1.28` instead of `-1.28` Fixes: #48009 (cherry picked from commit 4dee4bf)
39 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SELECT TRUNCATE(-1.5), TRUNCATE(-(1.5)), -(1.5)
While the result should be obvious, in case it isn't
-(1.5)
seems to evaluate in the end to 1.5.The text was updated successfully, but these errors were encountered: