Skip to content

Commit 5346e3d

Browse files
committed
Bumping to latest Vitess dev build from fulghum/alter-table-extensions branch
1 parent 1c84e91 commit 5346e3d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662
77
github.com/dolthub/jsonpath v0.0.2-0.20240227200619-19675ab05c71
88
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81
9-
github.com/dolthub/vitess v0.0.0-20240919225659-2ad81685e772
9+
github.com/dolthub/vitess v0.0.0-20241001235747-8ed913ec76b7
1010
github.com/go-kit/kit v0.10.0
1111
github.com/go-sql-driver/mysql v1.7.2-0.20231213112541-0004702b931d
1212
github.com/gocraft/dbr/v2 v2.7.2

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81 h1:7/v8q9X
6060
github.com/dolthub/sqllogictest/go v0.0.0-20201107003712-816f3ae12d81/go.mod h1:siLfyv2c92W1eN/R4QqG/+RjjX5W2+gCTRjZxBjI3TY=
6161
github.com/dolthub/vitess v0.0.0-20240919225659-2ad81685e772 h1:vDwBX7Lc8DnA8Zk0iRIu6slCw0GIUfYfFlYDYJQw8GQ=
6262
github.com/dolthub/vitess v0.0.0-20240919225659-2ad81685e772/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
63+
github.com/dolthub/vitess v0.0.0-20241001235747-8ed913ec76b7 h1:og740P9fUy1NzcmMhhAM/kTOFSjzy4ENzp6XUDc77uY=
64+
github.com/dolthub/vitess v0.0.0-20241001235747-8ed913ec76b7/go.mod h1:uBvlRluuL+SbEWTCZ68o0xvsdYZER3CEG/35INdzfJM=
6365
github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
6466
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
6567
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=

sql/planbuilder/ddl.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -937,19 +937,20 @@ func (b *Builder) buildAlterNotNull(inScope *scope, ddl *ast.DDL, table *plan.Re
937937
spec := ddl.NotNullSpec
938938
for _, c := range table.Schema() {
939939
if strings.EqualFold(c.Name, spec.Column.String()) {
940+
colCopy := *c
940941
switch strings.ToLower(spec.Action) {
941942
case ast.SetStr:
942943
// Set NOT NULL constraint
943-
c.Nullable = false
944+
colCopy.Nullable = false
944945
case ast.DropStr:
945946
// Drop NOT NULL constraint
946-
c.Nullable = true
947+
colCopy.Nullable = true
947948
default:
948949
err := sql.ErrUnsupportedFeature.New(ast.String(ddl))
949950
b.handleErr(err)
950951
}
951952

952-
modifyColumn := plan.NewModifyColumnResolved(table, c.Name, *c, nil)
953+
modifyColumn := plan.NewModifyColumnResolved(table, c.Name, colCopy, nil)
953954
outScope.node = b.modifySchemaTarget(inScope, modifyColumn, table.Schema())
954955
return
955956
}
@@ -964,13 +965,14 @@ func (b *Builder) buildAlterChangeColumnType(inScope *scope, ddl *ast.DDL, table
964965
spec := ddl.ColumnTypeSpec
965966
for _, c := range table.Schema() {
966967
if strings.EqualFold(c.Name, spec.Column.String()) {
968+
colCopy := *c
967969
typ, err := types.ColumnTypeToType(&spec.Type)
968970
if err != nil {
969971
b.handleErr(err)
970972
return
971973
}
972-
c.Type = typ
973-
modifyColumn := plan.NewModifyColumnResolved(table, c.Name, *c, nil)
974+
colCopy.Type = typ
975+
modifyColumn := plan.NewModifyColumnResolved(table, c.Name, colCopy, nil)
974976
outScope.node = b.modifySchemaTarget(inScope, modifyColumn, table.Schema())
975977
return
976978
}

0 commit comments

Comments
 (0)