Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pingcap/parser into fix/c…
Browse files Browse the repository at this point in the history
…reate_index_visible_invisible

# Conflicts:
#	parser.go
  • Loading branch information
zhenghaoz committed Aug 26, 2019
2 parents 5a6e30b + 091e94e commit bc0d059
Show file tree
Hide file tree
Showing 4 changed files with 3,497 additions and 3,446 deletions.
9 changes: 7 additions & 2 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,8 @@ const (
AlterTableDiscardPartitionTablespace
AlterTableAlterCheck
AlterTableDropCheck

AlterTableImportTablespace
AlterTableDiscardTablespace
// TODO: Add more actions
)

Expand Down Expand Up @@ -2345,6 +2346,10 @@ func (n *AlterTableSpec) Restore(ctx *RestoreCtx) error {
case AlterTableDropCheck:
ctx.WriteKeyWord("DROP CHECK ")
ctx.WriteName(n.Constraint.Name)
case AlterTableImportTablespace:
ctx.WriteKeyWord("IMPORT TABLESPACE")
case AlterTableDiscardTablespace:
ctx.WriteKeyWord("DISCARD TABLESPACE")
default:
// TODO: not support
ctx.WritePlainf(" /* AlterTableType(%d) is not supported */ ", n.Tp)
Expand Down Expand Up @@ -2413,7 +2418,7 @@ func (n *AlterTableStmt) Restore(ctx *RestoreCtx) error {
return errors.Annotate(err, "An error occurred while restore AlterTableStmt.Table")
}
for i, spec := range n.Specs {
if i == 0 || spec.Tp == AlterTablePartition || spec.Tp == AlterTableRemovePartitioning {
if i == 0 || spec.Tp == AlterTablePartition || spec.Tp == AlterTableRemovePartitioning || spec.Tp == AlterTableImportTablespace || spec.Tp == AlterTableDiscardTablespace {
ctx.WritePlain(" ")
} else {
ctx.WritePlain(", ")
Expand Down
Loading

0 comments on commit bc0d059

Please sign in to comment.