# LogicTest: local

# Use multiple column families.

statement ok
CREATE TABLE t9 (
  a INT PRIMARY KEY,
  b INT,
  c INT,
  d INT,
  e INT,
  FAMILY (a),
  FAMILY (b),
  FAMILY (c),
  FAMILY (d, e),
  CHECK (a > b),
  CHECK (d IS NULL)
)

# Only column families that are needed to validate check constraints are fetched.
query T
EXPLAIN (VERBOSE) UPDATE t9 SET b = b + 1 WHERE a = 5
----
distribution: local
vectorized: true
·
• update
│ columns: ()
│ estimated row count: 0 (missing stats)
│ table: t9
│ set: b
│ auto commit
│
└── • render
    │ columns: (a, b, b_new, check1)
    │ render check1: a > b_new
    │ render a: a
    │ render b: b
    │ render b_new: b_new
    │
    └── • render
        │ columns: (b_new, a, b)
        │ render b_new: b + 1
        │ render a: a
        │ render b: b
        │
        └── • scan
              columns: (a, b)
              estimated row count: 1 (missing stats)
              table: t9@t9_pkey
              spans: /5/0-/5/1/2
              locking strength: for update

query T
EXPLAIN (VERBOSE) UPDATE t9 SET a = 2 WHERE a = 5
----
distribution: local
vectorized: true
·
• update
│ columns: ()
│ estimated row count: 0 (missing stats)
│ table: t9
│ set: a
│ auto commit
│
└── • render
    │ columns: (a, b, c, d, e, a_new, check1)
    │ render check1: b < 2
    │ render a_new: 2
    │ render a: a
    │ render b: b
    │ render c: c
    │ render d: d
    │ render e: e
    │
    └── • scan
          columns: (a, b, c, d, e)
          estimated row count: 1 (missing stats)
          table: t9@t9_pkey
          spans: /5-/6
          locking strength: for update
