Skip to content
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

wip: Extend VSchema DDL to add/drop columns #14080

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ type (

// AutoIncSpec is set for AddAutoIncDDLAction.
AutoIncSpec *AutoIncSpec

AlterOptions []AlterOption
}

// ShowMigrationLogs represents a SHOW VITESS_MIGRATION '<uuid>' LOGS statement
Expand Down
1 change: 1 addition & 0 deletions go/vt/sqlparser/ast_clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion go/vt/sqlparser/ast_copy_on_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion go/vt/sqlparser/ast_equals.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions go/vt/sqlparser/ast_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ func (node *AlterVschema) Format(buf *TrackedBuffer) {
buf.astPrintf(node, "alter vschema add table %v", node.Table)
case DropVschemaTableDDLAction:
buf.astPrintf(node, "alter vschema drop table %v", node.Table)
case AlterVschemaTableDDLAction:
buf.astPrintf(node, "alter vschema table %v", node.Table)
case AddColVindexDDLAction:
buf.astPrintf(node, "alter vschema on %v add vindex %v (", node.Table, node.VindexSpec.Name)
for i, col := range node.VindexCols {
Expand Down
3 changes: 3 additions & 0 deletions go/vt/sqlparser/ast_format_fast.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions go/vt/sqlparser/ast_funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,8 @@ func (action DDLAction) ToString() string {
return AddVschemaTableStr
case DropVschemaTableDDLAction:
return DropVschemaTableStr
case AlterVschemaTableDDLAction:
return AlterVschemaTableStr
case AddColVindexDDLAction:
return AddColVindexStr
case DropColVindexDDLAction:
Expand Down
9 changes: 9 additions & 0 deletions go/vt/sqlparser/ast_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions go/vt/sqlparser/ast_visit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion go/vt/sqlparser/cached_size.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 17 additions & 15 deletions go/vt/sqlparser/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ const (
VariableStr = "variable"

// DDL strings.
CreateStr = "create"
AlterStr = "alter"
DeallocateStr = "deallocate"
DropStr = "drop"
RenameStr = "rename"
TruncateStr = "truncate"
FlushStr = "flush"
CreateVindexStr = "create vindex"
DropVindexStr = "drop vindex"
AddVschemaTableStr = "add vschema table"
DropVschemaTableStr = "drop vschema table"
AddColVindexStr = "on table add vindex"
DropColVindexStr = "on table drop vindex"
AddSequenceStr = "add sequence"
AddAutoIncStr = "add auto_increment"
CreateStr = "create"
AlterStr = "alter"
DeallocateStr = "deallocate"
DropStr = "drop"
RenameStr = "rename"
TruncateStr = "truncate"
FlushStr = "flush"
CreateVindexStr = "create vindex"
DropVindexStr = "drop vindex"
AddVschemaTableStr = "add vschema table"
DropVschemaTableStr = "drop vschema table"
AlterVschemaTableStr = "alter vschema table"
AddColVindexStr = "on table add vindex"
DropColVindexStr = "on table drop vindex"
AddSequenceStr = "add sequence"
AddAutoIncStr = "add auto_increment"

// ALTER TABLE ALGORITHM string.
DefaultStr = "default"
Expand Down Expand Up @@ -486,6 +487,7 @@ const (
DropVindexDDLAction
AddVschemaTableDDLAction
DropVschemaTableDDLAction
AlterVschemaTableDDLAction
AddColVindexDDLAction
DropColVindexDDLAction
AddSequenceDDLAction
Expand Down
Loading