-
Notifications
You must be signed in to change notification settings - Fork 5.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
Refactor parser: Avoid some assertion for StmtNode #4705
Conversation
/run-all-tests |
LGTM |
parser/parser.y
Outdated
ShowStmt "Show engines/databases/tables/columns/warnings/status statement" | ||
Statement "statement" | ||
ExplainableStmt "explainable statement" | ||
TruncateTableStmt "TRANSACTION TABLE statement" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
align these 5 lines.
| SubSelect | ||
{ | ||
// `(select 1)`; is a valid select statement | ||
// TODO: This is used to fix issue #320. There may be a better solution. | ||
$$ = $1.(*ast.SubqueryExpr).Query | ||
$$ = $1.(*ast.SubqueryExpr).Query.(ast.StmtNode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we add type assertion here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$1.(*ast.SubqueryExpr).Query is a ResultSet, not StmtNode.
@XuHuaiyu PTAL |
circleci failed @shenli |
@XuHuaiyu I can not open CircleCI now. I merge master and rerun it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Make code cleaner. No performance improvement.
Before:
After: