Skip to content

Commit

Permalink
[parser] parser: rename auto rand table option (pingcap#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid authored and ti-chi-bot committed Oct 9, 2021
1 parent 97e61ae commit 96e2a03
Show file tree
Hide file tree
Showing 6 changed files with 7,918 additions and 7,910 deletions.
6 changes: 3 additions & 3 deletions parser/ast/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1731,7 +1731,7 @@ const (
TableOptionCollate
TableOptionAutoIdCache
TableOptionAutoIncrement
TableOptionAutoRandom
TableOptionAutoRandomBase
TableOptionComment
TableOptionAvgRowLength
TableOptionCheckSum
Expand Down Expand Up @@ -1843,8 +1843,8 @@ func (n *TableOption) Restore(ctx *format.RestoreCtx) error {
ctx.WriteKeyWord("AUTO_ID_CACHE ")
ctx.WritePlain("= ")
ctx.WritePlainf("%d", n.UintValue)
case TableOptionAutoRandom:
ctx.WriteKeyWord("AUTO_RANDOM ")
case TableOptionAutoRandomBase:
ctx.WriteKeyWord("AUTO_RANDOM_BASE ")
ctx.WritePlain("= ")
ctx.WritePlainf("%d", n.UintValue)
case TableOptionComment:
Expand Down
1 change: 1 addition & 0 deletions parser/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ var tokenMap = map[string]int{
"AUTO_INCREMENT": autoIncrement,
"AUTO_ID_CACHE": autoIdCache,
"AUTO_RANDOM": autoRandom,
"AUTO_RANDOM_BASE": autoRandomBase,
"AVG_ROW_LENGTH": avgRowLength,
"AVG": avg,
"BACKUP": backup,
Expand Down
4 changes: 2 additions & 2 deletions parser/model/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (
ActionAddColumns ActionType = 37
ActionDropColumns ActionType = 38
ActionModifyTableAutoIdCache ActionType = 39
ActionRebaseAutoRandom ActionType = 40
ActionRebaseAutoRandomBase ActionType = 40
)

const (
Expand Down Expand Up @@ -118,7 +118,7 @@ var actionMap = map[ActionType]string{
ActionAddColumns: "add multi-columns",
ActionDropColumns: "drop multi-columns",
ActionModifyTableAutoIdCache: "modify auto id cache",
ActionRebaseAutoRandom: "rebase auto_random ID",
ActionRebaseAutoRandomBase: "rebase auto_random ID",
}

// String return current ddl action in string
Expand Down
Loading

0 comments on commit 96e2a03

Please sign in to comment.