*: support parsing BACKUP and RESTORE statements#746
Merged
Conversation
e62fb52 to
f9e078c
Compare
Codecov Report
@@ Coverage Diff @@
## master #746 +/- ##
==========================================
+ Coverage 77.82% 78.03% +0.21%
==========================================
Files 40 40
Lines 14421 14632 +211
==========================================
+ Hits 11223 11418 +195
- Misses 2514 2535 +21
+ Partials 684 679 -5 |
tangenta
reviewed
Feb 18, 2020
| } | ||
| | "RATE_LIMIT" EqOpt LengthNum "MB" '/' "SECOND" | ||
| { | ||
| // TODO: check overflow? |
Contributor
Author
There was a problem hiding this comment.
@tangenta RATE_LIMIT = 9223372036854775807 MB/SECOND... admittedly this is not a real issue 😅
| {"backup database * to 'noop://' rate_limit 500 MB/second snapshot 5 minute ago", true, "BACKUP DATABASE * TO 'noop://' RATE_LIMIT = 500 MB/SECOND SNAPSHOT = 300000000 MICROSECOND AGO"}, | ||
| {"restore table g from 'noop://' concurrency 40 checksum 0 online 1", true, "RESTORE TABLE `g` FROM 'noop://' CONCURRENCY = 40 CHECKSUM = 0 ONLINE = 1"}, | ||
| { | ||
| // FIXME: should we really include the access key in the Restore() text??? |
Contributor
There was a problem hiding this comment.
Should we also handle SetPwdStmt.Restore()?
Contributor
Author
There was a problem hiding this comment.
😱. Perhaps deal with this later (e.g. add a WriteSecureString() method). This needs to be considered together with how TiDB uses Restore().
Collaborator
|
LGTM |
3pointer
reviewed
Mar 13, 2020
|
@kennytm please resolve conflicts, it seems to be merged soon |
Contributor
Author
|
PTAL again @tangenta @tiancaiamao thanks. |
Collaborator
|
LGTM |
tiancaiamao
approved these changes
Mar 16, 2020
tiancaiamao
pushed a commit
to tiancaiamao/parser
that referenced
this pull request
Apr 27, 2021
* *: support parsing BACKUP and RESTORE statements * parser: add SNAPSHOT = 'str' option to BACKUP statement
lyonzhi
pushed a commit
to lyonzhi/parser
that referenced
this pull request
Apr 25, 2024
* *: support parsing BACKUP and RESTORE statements * parser: add SNAPSHOT = 'str' option to BACKUP statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Added the BACKUP, RESTORE and SHOW BACKUP/RESTORE statements to parser.
These are needed for integrating BR into TiDB (PR will come later).
(Note: because the new unresolved keyword
S3_USE_ACCELERATE_ENDPOINTis longer than all existing tokens, forcinggofmtto replace the entire token map, I've taken advantage of this to sort the entire tokenMap)What is changed and how it works?
↑
Check List
Tests
Code changes
Side effects
Related changes