Skip to content

Commit

Permalink
*: add "show open tables" support (pingcap#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
july2993 authored and tiancaiamao committed Apr 17, 2019
1 parent de4274a commit 1c191a2
Show file tree
Hide file tree
Showing 4 changed files with 5,921 additions and 5,891 deletions.
4 changes: 4 additions & 0 deletions ast/dml.go
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,7 @@ const (
ShowBindings
ShowPumpStatus
ShowDrainerStatus
ShowOpenTables
)

// ShowStmt is a statement to provide information about databases, tables, columns and so on.
Expand Down Expand Up @@ -1912,6 +1913,9 @@ func (n *ShowStmt) Restore(ctx *RestoreCtx) error {
restoreOptFull()
ctx.WriteKeyWord("TABLES")
restoreShowDatabaseNameOpt()
case ShowOpenTables:
ctx.WriteKeyWord("OPEN TABLES")
restoreShowDatabaseNameOpt()
case ShowTableStatus:
ctx.WriteKeyWord("TABLE STATUS")
restoreShowDatabaseNameOpt()
Expand Down
1 change: 1 addition & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ var tokenMap = map[string]int{
"STATS_META": statsMeta,
"STATS_PERSISTENT": statsPersistent,
"STATUS": status,
"OPEN": open,
"STD": stddevPop,
"STDDEV": stddevPop,
"STDDEV_POP": stddevPop,
Expand Down
Loading

0 comments on commit 1c191a2

Please sign in to comment.