Skip to content

Commit

Permalink
Add Admin Telemetry Statement (pingcap#908) (pingcap#909)
Browse files Browse the repository at this point in the history
Signed-off-by: Breezewish <[email protected]>
  • Loading branch information
breezewish authored Jun 23, 2020
1 parent 789c193 commit 3a18f1e
Show file tree
Hide file tree
Showing 5 changed files with 7,811 additions and 7,749 deletions.
6 changes: 6 additions & 0 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,8 @@ const (
AdminCaptureBindings
AdminEvolveBindings
AdminReloadBindings
AdminShowTelemetry
AdminResetTelemetryID
)

// HandleRange represents a range where handle value >= Begin and < End.
Expand Down Expand Up @@ -1827,6 +1829,10 @@ func (n *AdminStmt) Restore(ctx *format.RestoreCtx) error {
ctx.WriteKeyWord("EVOLVE BINDINGS")
case AdminReloadBindings:
ctx.WriteKeyWord("RELOAD BINDINGS")
case AdminShowTelemetry:
ctx.WriteKeyWord("SHOW TELEMETRY")
case AdminResetTelemetryID:
ctx.WriteKeyWord("RESET TELEMETRY_ID")
default:
return errors.New("Unsupported AdminStmt type")
}
Expand Down
3 changes: 3 additions & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ var tokenMap = map[string]int{
"REPLICA": replica,
"REPLICATION": replication,
"REQUIRE": require,
"RESET": reset,
"RESPECT": respect,
"RESTORE": restore,
"RESTORES": restores,
Expand Down Expand Up @@ -637,6 +638,8 @@ var tokenMap = map[string]int{
"TABLE": tableKwd,
"TABLES": tables,
"TABLESPACE": tablespace,
"TELEMETRY": telemetry,
"TELEMETRY_ID": telemetryID,
"TEMPORARY": temporary,
"TEMPTABLE": temptable,
"TERMINATED": terminated,
Expand Down
Loading

0 comments on commit 3a18f1e

Please sign in to comment.