We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Consider the following two expressions, which are not the same:
let expr1 = expr1.and(expr2.or(expr3)); let expr2 = expr1.and(expr2).or(expr3);
They both produce the same string from canonical_name:
canonical_name
a < Int32(1) AND b < Int32(2) OR c < Int32(3)
This is not only confusing when reading plans but could also lead to optimization rules altering plans to have different semantics.
To Reproduce
Expected behavior They should produce different results:
expr1.and(expr2.or(expr3)) should produce:
expr1.and(expr2.or(expr3))
a < Int32(1) AND (b < Int32(2) OR c < Int32(3))
expr1.and(expr2).or(expr3) should produce either of these:
expr1.and(expr2).or(expr3)
a < Int32(1) AND b < Int32(2) OR c < Int32(3) (a < Int32(1) AND b < Int32(2)) OR c < Int32(3)
There are two ways of resolving this:
Additional context
The text was updated successfully, but these errors were encountered:
Expr
SQL parser precedence logic for reference: https://github.com/sqlparser-rs/sqlparser-rs/blob/main/src/parser.rs#L1552-L1638
Sorry, something went wrong.
andygrove
Successfully merging a pull request may close this issue.
Describe the bug
Consider the following two expressions, which are not the same:
They both produce the same string from
canonical_name
:This is not only confusing when reading plans but could also lead to optimization rules altering plans to have different semantics.
To Reproduce
Expected behavior
They should produce different results:
expr1.and(expr2.or(expr3))
should produce:expr1.and(expr2).or(expr3)
should produce either of these:There are two ways of resolving this:
Additional context
The text was updated successfully, but these errors were encountered: