Skip to content

Commit

Permalink
[parser] parser,ast: parse ALTER TABLE .. TRUNCATE PARTITION (pingcap#74
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tiancaiamao authored and xhebox committed Oct 8, 2021
1 parent 1dac708 commit fa95456
Show file tree
Hide file tree
Showing 5 changed files with 2,992 additions and 2,969 deletions.
1 change: 1 addition & 0 deletions parser/ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,7 @@ const (
AlterTableAddPartitions
AlterTableCoalescePartitions
AlterTableDropPartition
AlterTableTruncatePartition

// TODO: Add more actions
)
Expand Down
4 changes: 3 additions & 1 deletion parser/model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const (
ActionDropTablePartition ActionType = 20
ActionCreateView ActionType = 21
ActionModifyTableCharsetAndCollate ActionType = 22
ActionTruncateTablePartition ActionType = 23
)

// AddIndexStr is a string related to the operation of "add index".
Expand All @@ -77,9 +78,10 @@ var actionMap = map[ActionType]string{
ActionModifyTableComment: "modify table comment",
ActionRenameIndex: "rename index",
ActionAddTablePartition: "add partition",
ActionDropTablePartition: "drop table partition",
ActionDropTablePartition: "drop partition",
ActionCreateView: "create view",
ActionModifyTableCharsetAndCollate: "modify table charset and collate",
ActionTruncateTablePartition: "truncate partition",
}

// String return current ddl action in string
Expand Down
Loading

0 comments on commit fa95456

Please sign in to comment.