Skip to content

Commit

Permalink
parser,ast: parse ALTER TABLE .. TRUNCATE PARTITION (#74) (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored and jackysp committed Jan 16, 2019
1 parent db06413 commit 00e6929
Show file tree
Hide file tree
Showing 5 changed files with 2,783 additions and 2,761 deletions.
1 change: 1 addition & 0 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ const (
AlterTableForce
AlterTableAddPartitions
AlterTableDropPartition
AlterTableTruncatePartition

// TODO: Add more actions
)
Expand Down
4 changes: 3 additions & 1 deletion 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 00e6929

Please sign in to comment.