Temporary Table support in unsharded keyspace#7411
Merged
systay merged 13 commits intovitessio:masterfrom Feb 10, 2021
Merged
Conversation
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…ection if the ReservedConn field is set Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
f1f788f to
94a0926
Compare
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Collaborator
|
@harshit-gangal we need to document the caching behaviour |
Member
Author
|
We need to document temp table support. :)
|
Member
Author
|
Documentation: vitessio/website#702 |
Signed-off-by: Andres Taylor <andres@planetscale.com>
shlomi-noach
approved these changes
Feb 10, 2021
| buf.WriteString("temporary ") | ||
| } | ||
| buf.WriteString("table ") | ||
|
|
| // IsTemporary implements the DDLStatement interface | ||
| func (node *DropTable) IsTemporary() bool { | ||
| return node.Temp | ||
| } |
| CREATE temp_opt TABLE not_exists_opt table_name | ||
| { | ||
| $$ = &CreateTable{Table: $4, IfNotExists: $3} | ||
| $$ = &CreateTable{Table: $5, IfNotExists: $4, Temp: $2} |
| if ddl.CreateTempTable { | ||
| vcursor.Session().HasCreatedTempTable() | ||
| vcursor.Session().NeedsReservedConn() | ||
| return ddl.NormalDDL.Execute(vcursor, bindVars, wantfields) |
| if normalDDLPlan.Keyspace.Sharded { | ||
| return nil, vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "Temporary table not supported in sharded keyspace: %s", normalDDLPlan.Keyspace.Name) | ||
| } | ||
| onlineDDLPlan = nil // emptying this so it does not accidentally gets used somewhere |
| DDL: ddlStatement, | ||
| NormalDDL: normalDDLPlan, | ||
| OnlineDDL: onlineDDLPlan, | ||
| CreateTempTable: ddlStatement.IsTemporary(), |
Contributor
There was a problem hiding this comment.
It feels like a bit of high level location to place this low level information, but I see why this is necessary.
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
This adds temp table support to unsharded keyspace.
Related Issue(s)
Checklist
Deployment Notes
Impacted Areas in Vitess
Components that this PR will affect: