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

ast, parser: support syntax for "EXPLAIN FORMAT = stringlit" #4554

Merged
merged 5 commits into from Sep 19, 2017

Conversation

Projects
None yet
3 participants
@zz-jason
Member

zz-jason commented Sep 18, 2017

to #4279

The default format is ROW, and we can add another format like DOT(#3933 ), and print a dot graph

@zz-jason

This comment has been minimized.

Show comment
Hide comment
@zz-jason
Member

zz-jason commented Sep 18, 2017

@winkyao PTAL

Format: "row",
}
}
| ExplainSym "FORMAT" "=" stringLit ExplainableStmt

This comment has been minimized.

@XuHuaiyu

XuHuaiyu Sep 18, 2017

Contributor

please add test for this

@XuHuaiyu

XuHuaiyu Sep 18, 2017

Contributor

please add test for this

This comment has been minimized.

@zz-jason

zz-jason Sep 19, 2017

Member

added

@zz-jason
@@ -84,7 +84,8 @@ type AuthOption struct {
type ExplainStmt struct {
stmtNode
Stmt StmtNode
Stmt StmtNode
Format string

This comment has been minimized.

@winkyao

winkyao Sep 18, 2017

Member

Could we use "const" instead of a string?

@winkyao

winkyao Sep 18, 2017

Member

Could we use "const" instead of a string?

This comment has been minimized.

@zz-jason

zz-jason Sep 19, 2017

Member

no we can't, when a input explain format is not supported, we should return an error like
ERROR 1791 (HY000): Unknown EXPLAIN format name: '%s'

@zz-jason

zz-jason Sep 19, 2017

Member

no we can't, when a input explain format is not supported, we should return an error like
ERROR 1791 (HY000): Unknown EXPLAIN format name: '%s'

@winkyao

add test in parser_test.go and reset LGTM

zz-jason added some commits Sep 19, 2017

@winkyao winkyao added the status/LGT1 label Sep 19, 2017

@XuHuaiyu

LGTM

@XuHuaiyu XuHuaiyu merged commit a303748 into master Sep 19, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 72.795%
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@XuHuaiyu XuHuaiyu deleted the zz-jason/explain/syntax branch Sep 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment