# 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 TTTTT
EXPLAIN (VERBOSE) UPDATE t9 SET b = 2 WHERE a = 5
----
count                ·         ·                          ()                                 ·
 └── update          ·         ·                          ()                                 ·
      │              table     t9                         ·                                  ·
      │              set       b                          ·                                  ·
      │              strategy  updater                    ·                                  ·
      │              check 0   t9.a > t9.b                ·                                  ·
      │              check 1   t9.d IS NULL               ·                                  ·
      └── render     ·         ·                          (a, b, d, "?column?")              a=CONST; "?column?"=CONST; key()
           │         render 0  test.public.t9.a           ·                                  ·
           │         render 1  test.public.t9.b           ·                                  ·
           │         render 2  test.public.t9.d           ·                                  ·
           │         render 3  2                          ·                                  ·
           └── scan  ·         ·                          (a, b, c[omitted], d, e[omitted])  a=CONST; key()
·                    table     t9@primary                 ·                                  ·
·                    spans     /5/0-/5/1/2 /5/3/1-/5/3/2  ·                                  ·
·                    parallel  ·                          ·                                  ·


query TTTTT
EXPLAIN (VERBOSE) UPDATE t9 SET a = 2 WHERE a = 5
----
count                ·         ·                 ()                           ·
 └── update          ·         ·                 ()                           ·
      │              table     t9                ·                            ·
      │              set       a                 ·                            ·
      │              strategy  updater           ·                            ·
      │              check 0   t9.a > t9.b       ·                            ·
      │              check 1   t9.d IS NULL      ·                            ·
      └── render     ·         ·                 (a, b, c, d, e, "?column?")  a=CONST; "?column?"=CONST; key()
           │         render 0  test.public.t9.a  ·                            ·
           │         render 1  test.public.t9.b  ·                            ·
           │         render 2  test.public.t9.c  ·                            ·
           │         render 3  test.public.t9.d  ·                            ·
           │         render 4  test.public.t9.e  ·                            ·
           │         render 5  2                 ·                            ·
           └── scan  ·         ·                 (a, b, c, d, e)              a=CONST; key()
·                    table     t9@primary        ·                            ·
·                    spans     /5-/5/#           ·                            ·
