Merged
Conversation
46a054e to
fed1607
Compare
rafael
reviewed
Dec 5, 2018
go/vt/vtgate/sandbox_test.go
Outdated
Member
There was a problem hiding this comment.
Why this change? Not obvious to me why we are adding this.
go/vt/sqlparser/sql.y
Outdated
Member
There was a problem hiding this comment.
Should we remove this token now from the grammar? It does not look like we need VSCHEMA_TABLES anymore
Member
|
Demmer I reviewed these three commits in the context of this PR:
Looks good to me. Added a few comments. Let me know your thoughts. |
Rework the vschema syntax so that instead of top-level create/drop statements and alter table we use a consistent syntax of: alter vschema create vindex... alter vschema drop vindex ... alter vschema on <table> add vindex ... alter vschema on <table> drop vindex ... Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Make the show syntax consistent: `show vschema vindexes` `show vschema tables` Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
Since unsharded keyspaces don't have vindex definitions, implement a new syntax for adding / removing tables from the vschema: `alter vschema add table test_table` `alter vschema drop table test_table` Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
fed1607 to
b55d155
Compare
Member
Author
|
@sougou Since this changes the alter syntax I think we should include it in 3.0 so we can then document this officially as the better way to do vschema operations. |
sougou
approved these changes
Dec 8, 2018
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.
Description
Rework the vschema DDL syntax to be clearer and more consistent and add the ability to manage unsharded keyspaces.
NOTE: This was rebased on top of #4385 now that it's in master.
Details
This PR reworks the syntax originally defined in #3459 with the benefit of hindsight and to add a missing feature to manage the vschema for unsharded keyspaces.
The new syntax implemented in this PR is:
Create / remove vindexes (note that for drop vindex the syntax is supported but the executor is not yet updated):
Associate vindexes with tables:
Associate vindex and define in one step:
New syntax for adding / removing tables from unsharded keyspaces:
New show statements: