-
Notifications
You must be signed in to change notification settings - Fork 598
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
bug(sqlsmith): generator needs to consider expression precedence #7671
Comments
IIUC, the problem may be deeper and more widespread. Is it possible that sqlsmith generate an AST like Given input Th parser itself would never build Maybe related to #7635. One idea is that parsed AST should not be aware of parentheses (i.e. remove |
Makes sense. We currently evade this problem in sqlsmith because of #7635. infix binop gets unparsed with parenthesis, hence we are able to parse and unparse After #7636, this "feature" of sqlsmith will be fixed. Additionally in 7636 we will also parenthesize I recommend we keep
Can't be displayed unambiguously without |
Basically 2 different approaches:
The upstream sqlparser is following the former approach, so does the recent PR #7636. But we used the latter parentheses approach when introducing sqlsmith (#3305). This may be how the bug arose and there may be no problem as long as we stick to one approach consistently rather than mixing them.
Another motivation to make parentheses insignificant in AST (i.e. remove |
Describe the bug
#7665 (comment)
To Reproduce
No response
Expected behavior
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: