exec-ddl
CREATE TABLE abcde (
    a INT NOT NULL,
    b INT,
    c INT NOT NULL DEFAULT (10),
    d INT AS (b + c + 1) STORED,
    "e:write-only" INT NOT NULL
)
----

exec-ddl
CREATE TABLE xyz (
    x TEXT PRIMARY KEY,
    y INT8 NOT NULL,
    z FLOAT8
)
----

# Properties with no RETURNING clause.
build
DELETE FROM abcde WHERE a=1
----
delete abcde
 ├── columns: <none>
 ├── fetch columns: a:9(int) b:10(int) c:11(int) d:12(int) rowid:13(int) e:14(int)
 ├── cardinality: [0 - 0]
 ├── volatile, mutations
 └── select
      ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
      ├── key: (13)
      ├── fd: ()-->(9), (13)-->(10-12,14-16), (10,11)-->(12)
      ├── prune: (10-16)
      ├── interesting orderings: (+13 opt(9))
      ├── scan abcde
      │    ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
      │    ├── computed column expressions
      │    │    └── d:12
      │    │         └── plus [type=int]
      │    │              ├── plus [type=int]
      │    │              │    ├── variable: b:10 [type=int]
      │    │              │    └── variable: c:11 [type=int]
      │    │              └── const: 1 [type=int]
      │    ├── flags: avoid-full-scan
      │    ├── key: (13)
      │    ├── fd: (13)-->(9-12,14-16), (10,11)-->(12)
      │    ├── prune: (9-16)
      │    └── interesting orderings: (+13)
      └── filters
           └── eq [type=bool, outer=(9), constraints=(/9: [/1 - /1]; tight), fd=()-->(9)]
                ├── variable: a:9 [type=int]
                └── const: 1 [type=int]

# Properties with RETURNING clause.
build
DELETE FROM abcde WHERE a=1 RETURNING *
----
project
 ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int)
 ├── volatile, mutations
 ├── fd: ()-->(1), (2,3)-->(4)
 ├── prune: (1-4)
 └── delete abcde
      ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int) rowid:5(int!null)
      ├── fetch columns: a:9(int) b:10(int) c:11(int) d:12(int) rowid:13(int) e:14(int)
      ├── return-mapping:
      │    ├── a:9 => a:1
      │    ├── b:10 => b:2
      │    ├── c:11 => c:3
      │    ├── d:12 => d:4
      │    └── rowid:13 => rowid:5
      ├── volatile, mutations
      ├── key: (5)
      ├── fd: ()-->(1), (5)-->(2-4), (2,3)-->(4)
      └── select
           ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
           ├── key: (13)
           ├── fd: ()-->(9), (13)-->(10-12,14-16), (10,11)-->(12)
           ├── prune: (10-16)
           ├── interesting orderings: (+13 opt(9))
           ├── scan abcde
           │    ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
           │    ├── computed column expressions
           │    │    └── d:12
           │    │         └── plus [type=int]
           │    │              ├── plus [type=int]
           │    │              │    ├── variable: b:10 [type=int]
           │    │              │    └── variable: c:11 [type=int]
           │    │              └── const: 1 [type=int]
           │    ├── flags: avoid-full-scan
           │    ├── key: (13)
           │    ├── fd: (13)-->(9-12,14-16), (10,11)-->(12)
           │    ├── prune: (9-16)
           │    └── interesting orderings: (+13)
           └── filters
                └── eq [type=bool, outer=(9), constraints=(/9: [/1 - /1]; tight), fd=()-->(9)]
                     ├── variable: a:9 [type=int]
                     └── const: 1 [type=int]

# Input is cardinality 0-1 expression.
build
DELETE FROM abcde WHERE rowid=1 RETURNING *
----
project
 ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int)
 ├── cardinality: [0 - 1]
 ├── volatile, mutations
 ├── key: ()
 ├── fd: ()-->(1-4)
 ├── prune: (1-4)
 └── delete abcde
      ├── columns: a:1(int!null) b:2(int) c:3(int!null) d:4(int) rowid:5(int!null)
      ├── fetch columns: a:9(int) b:10(int) c:11(int) d:12(int) rowid:13(int) e:14(int)
      ├── return-mapping:
      │    ├── a:9 => a:1
      │    ├── b:10 => b:2
      │    ├── c:11 => c:3
      │    ├── d:12 => d:4
      │    └── rowid:13 => rowid:5
      ├── cardinality: [0 - 1]
      ├── volatile, mutations
      ├── key: ()
      ├── fd: ()-->(1-5)
      └── select
           ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
           ├── cardinality: [0 - 1]
           ├── key: ()
           ├── fd: ()-->(9-16)
           ├── prune: (9-12,14-16)
           ├── scan abcde
           │    ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
           │    ├── computed column expressions
           │    │    └── d:12
           │    │         └── plus [type=int]
           │    │              ├── plus [type=int]
           │    │              │    ├── variable: b:10 [type=int]
           │    │              │    └── variable: c:11 [type=int]
           │    │              └── const: 1 [type=int]
           │    ├── flags: avoid-full-scan
           │    ├── key: (13)
           │    ├── fd: (13)-->(9-12,14-16), (10,11)-->(12)
           │    ├── prune: (9-16)
           │    └── interesting orderings: (+13)
           └── filters
                └── eq [type=bool, outer=(13), constraints=(/13: [/1 - /1]; tight), fd=()-->(13)]
                     ├── variable: rowid:13 [type=int]
                     └── const: 1 [type=int]

# Filter FD set.
build
DELETE FROM abcde WHERE b=c RETURNING *;
----
project
 ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int)
 ├── volatile, mutations
 ├── fd: (2)-->(4), (2)==(3), (3)==(2)
 ├── prune: (1-4)
 └── delete abcde
      ├── columns: a:1(int!null) b:2(int!null) c:3(int!null) d:4(int) rowid:5(int!null)
      ├── fetch columns: a:9(int) b:10(int) c:11(int) d:12(int) rowid:13(int) e:14(int)
      ├── return-mapping:
      │    ├── a:9 => a:1
      │    ├── b:10 => b:2
      │    ├── c:11 => c:3
      │    ├── d:12 => d:4
      │    └── rowid:13 => rowid:5
      ├── volatile, mutations
      ├── key: (5)
      ├── fd: (5)-->(1-4), (2)-->(4), (2)==(3), (3)==(2)
      └── select
           ├── columns: a:9(int!null) b:10(int!null) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
           ├── key: (13)
           ├── fd: (13)-->(9-12,14-16), (10,11)-->(12), (10)==(11), (11)==(10)
           ├── prune: (9,12-16)
           ├── interesting orderings: (+13)
           ├── scan abcde
           │    ├── columns: a:9(int!null) b:10(int) c:11(int!null) d:12(int) rowid:13(int!null) e:14(int) crdb_internal_mvcc_timestamp:15(decimal) tableoid:16(oid)
           │    ├── computed column expressions
           │    │    └── d:12
           │    │         └── plus [type=int]
           │    │              ├── plus [type=int]
           │    │              │    ├── variable: b:10 [type=int]
           │    │              │    └── variable: c:11 [type=int]
           │    │              └── const: 1 [type=int]
           │    ├── flags: avoid-full-scan
           │    ├── key: (13)
           │    ├── fd: (13)-->(9-12,14-16), (10,11)-->(12)
           │    ├── prune: (9-16)
           │    └── interesting orderings: (+13)
           └── filters
                └── eq [type=bool, outer=(10,11), constraints=(/10: (/NULL - ]; /11: (/NULL - ]), fd=(10)==(11), (11)==(10)]
                     ├── variable: b:10 [type=int]
                     └── variable: c:11 [type=int]
