Skip to content

Commit

Permalink
parser: add support for show pump/drainer status (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
caohe authored and WangXiangUSTC committed Feb 21, 2019
1 parent ea60bf4 commit f7d7526
Show file tree
Hide file tree
Showing 4 changed files with 5,641 additions and 5,589 deletions.
6 changes: 6 additions & 0 deletions ast/dml.go
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,8 @@ const (
ShowPrivileges
ShowErrors
ShowBindings
ShowPumpStatus
ShowDrainerStatus
)

// ShowStmt is a statement to provide information about databases, tables, columns and so on.
Expand Down Expand Up @@ -1937,6 +1939,10 @@ func (n *ShowStmt) Restore(ctx *RestoreCtx) error {
ctx.WriteKeyWord("SESSION ")
}
ctx.WriteKeyWord("BINDINGS")
case ShowPumpStatus:
ctx.WriteKeyWord("PUMP STATUS")
case ShowDrainerStatus:
ctx.WriteKeyWord("DRAINER STATUS")
default:
return errors.New("Unknown ShowStmt type")
}
Expand Down
2 changes: 2 additions & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ var tokenMap = map[string]int{
"DIV": div,
"DO": do,
"DOUBLE": doubleType,
"DRAINER": drainer,
"DROP": drop,
"DUAL": dual,
"DUPLICATE": duplicate,
Expand Down Expand Up @@ -392,6 +393,7 @@ var tokenMap = map[string]int{
"PROCESS": process,
"PROCESSLIST": processlist,
"PROFILES": profiles,
"PUMP": pump,
"QUARTER": quarter,
"QUERY": query,
"QUERIES": queries,
Expand Down
Loading

0 comments on commit f7d7526

Please sign in to comment.