Skip to content

Commit

Permalink
add support for TABLE_CHECKSUM
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky committed Aug 15, 2019
1 parent 15ebd4e commit 72e1725
Show file tree
Hide file tree
Showing 5 changed files with 6,705 additions and 6,678 deletions.
5 changes: 5 additions & 0 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,7 @@ const (
TableOptionSecondaryEngine
TableOptionSecondaryEngineNull
TableOptionInsertMethod
TableOptionTableCheckSum
)

// RowFormat types
Expand Down Expand Up @@ -1728,6 +1729,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 @@ -546,6 +546,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 72e1725

Please sign in to comment.