Skip to content

cdc: cannot use UDT cast in changefeed expression #90714

@jayshrivastava

Description

@jayshrivastava

When you create a changefeed expression which references UDTs, some weird behavior occurs:

CREATE TYPE status AS ENUM ('inactive', 'active');

CREATE TYPE priority AS ENUM ('high', 'low');

CREATE TABLE foo (
    a INT PRIMARY KEY,
    b status,
    c priority,
    FAMILY only_b (b),
    FAMILY only_c (c)
);      


root@localhost:26257/defaultdb> CREATE CHANGEFEED WITH split_column_families AS SELECT 'inactive'::status, c FROM foo;
ERROR: undefined object with OID 100113
SQLSTATE: 42704

Also this:

root@localhost:26257/defaultdb> CREATE CHANGEFEED WITH split_column_families, schema_change_policy='stop'  AS SELECT 'inactive'::status from foo;
ERROR: expressions can't reference columns from more than one column family
SQLSTATE: 22023

Neither of these errors should happen since the changefeed expressions are valid.

Jira issue: CRDB-20905

Epic CRDB-17161

Metadata

Metadata

Assignees

Labels

A-cdcChange Data CaptureC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-cdc

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions