Skip to content

Commit

Permalink
Add vexplain trace (#16768)
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
  • Loading branch information
systay and frouioui committed Sep 20, 2024
1 parent b058ba2 commit 5a26444
Show file tree
Hide file tree
Showing 18 changed files with 8,558 additions and 8,219 deletions.
2 changes: 2 additions & 0 deletions go/vt/sqlparser/ast_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1895,6 +1895,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 @@ -272,6 +272,7 @@ const (
QueriesStr = "queries"
AllVExplainStr = "all"
PlanStr = "plan"
TraceStr = "trace"

// Lock Types
ReadStr = "read"
Expand Down Expand Up @@ -833,6 +834,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 @@ -706,6 +706,7 @@ var keywords = []keyword{
{"tinyint", TINYINT},
{"tinytext", TINYTEXT},
{"to", TO},
{"trace", TRACE},
{"trailing", TRAILING},
{"transaction", TRANSACTION},
{"tree", TREE},
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 @@ -2546,6 +2546,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

0 comments on commit 5a26444

Please sign in to comment.