Skip to content

Commit

Permalink
fix: add support for TABLE_CHECKSUM (#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 b5eed07 commit 344a139
Show file tree
Hide file tree
Showing 5 changed files with 6,716 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 344a139

Please sign in to comment.