-
-
Notifications
You must be signed in to change notification settings - Fork 238
Allow SHOW CREATE to display auto increment for tables that store AutoIncrement but don't support writing it. #2864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -330,9 +330,7 @@ type TruncateableTable interface { | |
| // AUTO_INCREMENT sequence. These methods should only be used for tables with and AUTO_INCREMENT column in their schema. | ||
| type AutoIncrementTable interface { | ||
| Table | ||
| // PeekNextAutoIncrementValue returns the next AUTO_INCREMENT value without incrementing the current | ||
| // auto_increment counter. | ||
| PeekNextAutoIncrementValue(ctx *Context) (uint64, error) | ||
| AutoIncrementGetter | ||
| // GetNextAutoIncrementValue gets the next AUTO_INCREMENT value. In the case that a table with an autoincrement | ||
| // column is passed in a row with the autoinc column failed, the next auto increment value must | ||
| // update its internal state accordingly and use the insert val at runtime. | ||
|
|
@@ -342,6 +340,15 @@ type AutoIncrementTable interface { | |
| AutoIncrementSetter(*Context) AutoIncrementSetter | ||
| } | ||
|
|
||
| // AutoIncrementGetter provides support for reading a table's AUTO_INCREMENT value. | ||
| // This can include tables that don't implement AutoIncrementTable if the table is a read-only snapshot | ||
| // of an auto-incremented table. | ||
| type AutoIncrementGetter interface { | ||
| // PeekNextAutoIncrementValue returns the next AUTO_INCREMENT value without incrementing the current | ||
| // auto_increment counter. | ||
| PeekNextAutoIncrementValue(ctx *Context) (uint64, error) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also move the method doc from AutoIncrementTable.Peek to here |
||
| } | ||
|
|
||
| // AutoIncrementSetter provides support for altering a table's | ||
| // AUTO_INCREMENT sequence, eg 'ALTER TABLE t AUTO_INCREMENT = 10;' | ||
| type AutoIncrementSetter interface { | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please embed this in the
AutoIncrementTableinterface to make the relationship clearer