Skip to content
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

Add vexplain trace #16768

Merged
merged 11 commits into from
Sep 17, 2024
2 changes: 2 additions & 0 deletions go/vt/sqlparser/ast_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,8 @@ func (ty VExplainType) ToString() string {
return QueriesStr
case AllVExplainType:
return AllVExplainStr
case TraceVExplainType:
return TraceStr
default:
return "Unknown VExplainType"
}
Expand Down
2 changes: 2 additions & 0 deletions go/vt/sqlparser/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ const (
QueriesStr = "queries"
AllVExplainStr = "all"
PlanStr = "plan"
TraceStr = "trace"

// Lock Types
ReadStr = "read"
Expand Down Expand Up @@ -846,6 +847,7 @@ const (
QueriesVExplainType VExplainType = iota
PlanVExplainType
AllVExplainType
TraceVExplainType
)

// Constant for Enum Type - SelectIntoType
Expand Down
1 change: 1 addition & 0 deletions go/vt/sqlparser/keywords.go
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ var keywords = []keyword{
{"tinyint", TINYINT},
{"tinytext", TINYTEXT},
{"to", TO},
{"trace", TRACE},
{"trailing", TRAILING},
{"transaction", TRANSACTION},
{"transactions", TRANSACTIONS},
Expand Down
3 changes: 3 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,9 @@ var (
}, {
input: "vexplain select * from t",
output: "vexplain plan select * from t",
}, {
input: "vexplain trace select * from t",
output: "vexplain trace select * from t",
}, {
input: "explain analyze select * from t",
}, {
Expand Down
Loading
Loading