Skip to content

Commit

Permalink
parser: support the 'alter table xx cache' and 'alter table xx nocach…
Browse files Browse the repository at this point in the history
…e' (#28922)
  • Loading branch information
JayLZhou authored Oct 21, 2021
1 parent 6d24f8c commit 549fac6
Show file tree
Hide file tree
Showing 4 changed files with 4,032 additions and 3,994 deletions.
7 changes: 6 additions & 1 deletion parser/ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,8 @@ const (
AlterTableAddStatistics
AlterTableDropStatistics
AlterTableAttributes
AlterTableCache
AlterTableNoCache
)

// LockType is the type for AlterTableSpec.
Expand Down Expand Up @@ -3094,7 +3096,10 @@ func (n *AlterTableSpec) Restore(ctx *format.RestoreCtx) error {
if err := spec.Restore(ctx); err != nil {
return errors.Annotatef(err, "An error occurred while restore AlterTableSpec.AttributesSpec")
}

case AlterTableCache:
ctx.WriteKeyWord("CACHE")
case AlterTableNoCache:
ctx.WriteKeyWord("NOCACHE")
default:
// TODO: not support
ctx.WritePlainf(" /* AlterTableType(%d) is not supported */ ", n.Tp)
Expand Down
Loading

0 comments on commit 549fac6

Please sign in to comment.