Skip to content

Conversation

@matriv
Copy link
Contributor

@matriv matriv commented Mar 18, 2021

Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: #66145

Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: elastic#66145
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-ql (Team:QL)

Copy link
Contributor

@astefan astefan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@bpintea bpintea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matriv matriv merged commit db2cd3a into elastic:master Mar 19, 2021
@matriv matriv deleted the fix-66145 branch March 19, 2021 11:55
matriv added a commit to matriv/elasticsearch that referenced this pull request Mar 19, 2021
Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: elastic#66145
(cherry picked from commit db2cd3a)
matriv added a commit to matriv/elasticsearch that referenced this pull request Mar 19, 2021
Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: elastic#66145
(cherry picked from commit db2cd3a)
matriv added a commit that referenced this pull request Mar 19, 2021
Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: #66145
(cherry picked from commit db2cd3a)
matriv added a commit that referenced this pull request Mar 19, 2021
Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: #66145
(cherry picked from commit db2cd3a)
matriv added a commit that referenced this pull request Mar 19, 2021
Previously, the parentCtx checks on a unary arithmetic expression
stopped too early, resulting in wrong handling of nested minuses.

Use a while loop to reach the top level unary arithmetic expression
and count the number of minuses, an odd count means an acutal negation.

Fixes: #66145
(cherry picked from commit db2cd3a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQL: consecutive unary minuses ignored in literals

5 participants