Skip to content

Commit

Permalink
fix: add support for TABLE_CHECKSUM (pingcap#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky authored and Tanner committed Aug 16, 2019
1 parent 0e8f355 commit 8771162
Show file tree
Hide file tree
Showing 4 changed files with 6,714 additions and 6,689 deletions.
5 changes: 5 additions & 0 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,7 @@ const (
TableOptionSecondaryEngine
TableOptionSecondaryEngineNull
TableOptionInsertMethod
TableOptionTableCheckSum
)

// RowFormat types
Expand Down Expand Up @@ -1743,6 +1744,10 @@ func (n *TableOption) Restore(ctx *RestoreCtx) error {
ctx.WriteKeyWord("INSERT_METHOD ")
ctx.WritePlain("= ")
ctx.WriteString(n.StrValue)
case TableOptionTableCheckSum:
ctx.WriteKeyWord("TABLE_CHECKSUM ")
ctx.WritePlain("= ")
ctx.WritePlainf("%d", n.UintValue)
default:
return errors.Errorf("invalid TableOption: %d", n.Tp)
}
Expand Down
1 change: 1 addition & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ var tokenMap = map[string]int{
"SUM": sum,
"SUPER": super,
"TABLE": tableKwd,
"TABLE_CHECKSUM": tableChecksum,
"TABLES": tables,
"TABLESPACE": tablespace,
"TEMPORARY": temporary,
Expand Down
Loading

0 comments on commit 8771162

Please sign in to comment.