Skip to content

Commit

Permalink
add support for STORAGE table option (pingcap#407)
Browse files Browse the repository at this point in the history
* add support for STORAGE table option

* Apply suggestions from code review

Co-Authored-By: leoppro <i@leop.pro>

* add warning when parsing STORAGE
  • Loading branch information
leiysky authored and kennytm committed Jul 30, 2019
1 parent db60bb6 commit d731bc3
Show file tree
Hide file tree
Showing 4 changed files with 6,628 additions and 6,576 deletions.
4 changes: 4 additions & 0 deletions ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,7 @@ const (
TableOptionNodegroup
TableOptionDataDirectory
TableOptionIndexDirectory
TableOptionStorageMedia
)

// RowFormat types
Expand Down Expand Up @@ -1618,6 +1619,9 @@ func (n *TableOption) Restore(ctx *RestoreCtx) error {
ctx.WriteKeyWord("INDEX DIRECTORY ")
ctx.WritePlain("= ")
ctx.WriteString(n.StrValue)
case TableOptionStorageMedia:
ctx.WriteKeyWord("STORAGE ")
ctx.WriteKeyWord(n.StrValue)
default:
return errors.Errorf("invalid TableOption: %d", n.Tp)
}
Expand Down
2 changes: 2 additions & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ var tokenMap = map[string]int{
"DESCRIBE": describe,
"DIRECTORY": directory,
"DISABLE": disable,
"DISK": disk,
"DISTINCT": distinct,
"DISTINCTROW": distinct,
"DIV": div,
Expand Down Expand Up @@ -499,6 +500,7 @@ var tokenMap = map[string]int{
"STATS_META": statsMeta,
"STATS_PERSISTENT": statsPersistent,
"STATUS": status,
"STORAGE": storage,
"SWAPS": swaps,
"SWITCHES": switchesSym,
"SYSTEM_TIME": systemTime,
Expand Down
Loading

0 comments on commit d731bc3

Please sign in to comment.