Skip to content

Commit

Permalink
parser: support table option: 'ENCRYPTION' (pingcap#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
spongedu authored and leoppro committed Aug 26, 2019
1 parent 6cda5a6 commit d3a382c
Show file tree
Hide file tree
Showing 5 changed files with 3,366 additions and 3,340 deletions.
5 changes: 5 additions & 0 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1580,6 +1580,7 @@ const (
TableOptionSecondaryEngineNull
TableOptionInsertMethod
TableOptionTableCheckSum
TableOptionEncryption
)

// RowFormat types
Expand Down Expand Up @@ -1785,6 +1786,10 @@ func (n *TableOption) Restore(ctx *RestoreCtx) error {
ctx.WriteKeyWord("TABLE_CHECKSUM ")
ctx.WritePlain("= ")
ctx.WritePlainf("%d", n.UintValue)
case TableOptionEncryption:
ctx.WriteKeyWord("ENCRYPTION ")
ctx.WritePlain("= ")
ctx.WriteString(n.StrValue)
default:
return errors.Errorf("invalid TableOption: %d", n.Tp)
}
Expand Down
1 change: 1 addition & 0 deletions mysql/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,7 @@ const (
ErrJSONUsedAsKey = 3152
ErrInvalidJSONPathArrayCell = 3165
ErrBadUser = 3162
ErrInvalidEncryptionOption = 3184
ErrRoleNotGranted = 3530
ErrWindowNoSuchWindow = 3579
ErrWindowCircularityInWindowGraph = 3580
Expand Down
1 change: 1 addition & 0 deletions mysql/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ var MySQLErrName = map[uint16]string{
ErrInvalidJSONContainsPathType: "The second argument can only be either 'one' or 'all'.",
ErrJSONUsedAsKey: "JSON column '%-.192s' cannot be used in key specification.",
ErrInvalidJSONPathArrayCell: "A path expression is not a path to a cell in an array.",
ErrInvalidEncryptionOption: "Invalid encryption option.",
ErrWindowNoSuchWindow: "Window name '%s' is not defined.",
ErrWindowCircularityInWindowGraph: "There is a circularity in the window dependency graph.",
ErrWindowNoChildPartitioning: "A window which depends on another cannot define partitioning.",
Expand Down
Loading

0 comments on commit d3a382c

Please sign in to comment.