Skip to content

Commit

Permalink
[parser] parser: recognize BACKUP SNAPSHOT = TSO in additional to 'TI…
Browse files Browse the repository at this point in the history
…MESTAMP' (pingcap#782)
  • Loading branch information
kennytm authored and xhebox committed Oct 8, 2021
1 parent 91523d7 commit b38913d
Show file tree
Hide file tree
Showing 4 changed files with 3,196 additions and 3,178 deletions.
5 changes: 3 additions & 2 deletions parser/ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,7 @@ const (
// backup options
BRIEOptionBackupTimeAgo
BRIEOptionBackupTS
BRIEOptionBackupTSO
BRIEOptionLastBackupTS
BRIEOptionLastBackupTSO
// restore options
Expand Down Expand Up @@ -2291,7 +2292,7 @@ func (kind BRIEOptionType) String() string {
return "CHECKSUM"
case BRIEOptionSendCreds:
return "SEND_CREDENTIALS_TO_TIKV"
case BRIEOptionBackupTimeAgo, BRIEOptionBackupTS:
case BRIEOptionBackupTimeAgo, BRIEOptionBackupTS, BRIEOptionBackupTSO:
return "SNAPSHOT"
case BRIEOptionLastBackupTS:
return "INCREMENTAL UNTIL TIMESTAMP"
Expand Down Expand Up @@ -2417,7 +2418,7 @@ func (n *BRIEStmt) Restore(ctx *format.RestoreCtx) error {
ctx.WriteKeyWord(opt.Tp.String())
ctx.WritePlain(" = ")
switch opt.Tp {
case BRIEOptionConcurrency, BRIEOptionChecksum, BRIEOptionSendCreds, BRIEOptionOnline, BRIEOptionS3ForcePathStyle, BRIEOptionS3UseAccelerateEndpoint:
case BRIEOptionConcurrency, BRIEOptionChecksum, BRIEOptionSendCreds, BRIEOptionOnline, BRIEOptionS3ForcePathStyle, BRIEOptionS3UseAccelerateEndpoint, BRIEOptionBackupTSO:
ctx.WritePlainf("%d", opt.UintValue)
case BRIEOptionBackupTimeAgo:
ctx.WritePlainf("%d ", opt.UintValue/1000)
Expand Down
Loading

0 comments on commit b38913d

Please sign in to comment.