Skip to content

Commit 814abcc

Browse files
authored
Merge pull request #2940 from dolthub/fulghum/if_exists
Bug fix: ensure `DropCheck.IfExists` gets copied over to new instances
2 parents 0b20f87 + 3ee57e5 commit 814abcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/plan/alter_check.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ func (d *DropCheck) WithChildren(children ...sql.Node) (sql.Node, error) {
128128
if len(children) != 1 {
129129
return nil, sql.ErrInvalidChildrenNumber.New(d, len(children), 1)
130130
}
131-
return NewAlterDropCheck(children[0].(*ResolvedTable), d.Name), nil
131+
132+
newAlterDropCheck := NewAlterDropCheck(children[0].(*ResolvedTable), d.Name)
133+
newAlterDropCheck.IfExists = d.IfExists
134+
return newAlterDropCheck, nil
132135
}
133136

134137
// CollationCoercibility implements the interface sql.CollationCoercible.

0 commit comments

Comments
 (0)