Skip to content

Commit

Permalink
*: support where in admin show statement (pingcap#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazycs520 authored Oct 11, 2019
1 parent 57a53a8 commit aec1f0a
Show file tree
Hide file tree
Showing 3 changed files with 1,133 additions and 1,107 deletions.
7 changes: 7 additions & 0 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,7 @@ type AdminStmt struct {
HandleRanges []HandleRange
ShowSlow *ShowSlow
Plugins []string
Where ExprNode
}

// Restore implements Node interface.
Expand Down Expand Up @@ -1533,6 +1534,12 @@ func (n *AdminStmt) Restore(ctx *RestoreCtx) error {
if n.JobNumber != 0 {
ctx.WritePlainf(" %d", n.JobNumber)
}
if n.Where != nil {
ctx.WriteKeyWord(" WHERE ")
if err := n.Where.Restore(ctx); err != nil {
return errors.Annotate(err, "An error occurred while restore ShowStmt.Where")
}
}
case AdminShowNextRowID:
ctx.WriteKeyWord("SHOW ")
if err := restoreTables(); err != nil {
Expand Down
Loading

0 comments on commit aec1f0a

Please sign in to comment.