Skip to content

Order of operations when evaluating expressions is incorrect #4219

Description

@hazefully

For the following expressions, the order of operations for arithmetic and logical operators is not respected, and instead is applied left to right:

  • SELECT 3+5*6 FROM range(1, 2) -> returns 48, should instead return 33
  • SELECT * FROM T WHERE a > 0 or b > 0 AND c > 0 -> applies the AND operator to a > 0 or b > 0 and c > 0 instead of b > 0 and c > 0.

In both cases if parenthesis are added to the operators with the higher precedence , the result is correct.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions