Skip to content

Commit 6aa18f9

Browse files
committed
use child on no targets
1 parent bcd456b commit 6aa18f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/plan/delete.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ func (p *DeleteFrom) WithExplicitTargets(targets []sql.Node) *DeleteFrom {
7272

7373
// GetDeleteTargets returns the sql.Nodes representing the tables from which rows should be deleted.
7474
func (p *DeleteFrom) GetDeleteTargets() []sql.Node {
75-
return p.targets
75+
if len(p.targets) > 0 {
76+
return p.targets
77+
}
78+
return []sql.Node{p.Child}
7679
}
7780

7881
// Schema implements the sql.Node interface.

0 commit comments

Comments
 (0)