Skip to content

Commit

Permalink
[parser] statistics: introduce a new kind of syntax to drop global-st…
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 authored Mar 3, 2021
1 parent 6d61501 commit 1153b3f
Show file tree
Hide file tree
Showing 4 changed files with 3,440 additions and 3,418 deletions.
6 changes: 6 additions & 0 deletions parser/ast/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ type DropStatsStmt struct {

Table *TableName
PartitionNames []model.CIStr
IsGlobalStats bool
}

// Restore implements Node interface.
Expand All @@ -185,6 +186,11 @@ func (n *DropStatsStmt) Restore(ctx *format.RestoreCtx) error {
return errors.Annotate(err, "An error occurred while add table")
}

if n.IsGlobalStats {
ctx.WriteKeyWord(" GLOBAL")
return nil
}

if len(n.PartitionNames) != 0 {
ctx.WriteKeyWord(" PARTITION ")
}
Expand Down
Loading

0 comments on commit 1153b3f

Please sign in to comment.